Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
workspaces
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ssa
workspaces
Merge requests
!1460
Make sure we don't spam scientists without meaning to
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Make sure we don't spam scientists without meaning to
ws-1977-give-ui-user-notification-picoi-email-address
into
main
Overview
0
Commits
1
Pipelines
1
Changes
1
Merged
Nathan Bockisch
requested to merge
ws-1977-give-ui-user-notification-picoi-email-address
into
main
1 year ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
4c11d43b
1 commit,
1 year ago
1 file
+
9
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
services/capability/capability/views/capability_version.py
+
9
−
0
Options
@@ -34,6 +34,8 @@ from pyramid.view import view_config
logger
=
logging
.
getLogger
(
__name__
)
NOTIF_SETTINGS_KEY
=
"
edu.nrao.workspaces.NotificationSettings
"
from
workspaces.capability.enums
import
CapabilityVersionState
@@ -434,4 +436,11 @@ def get_user_email(request: Request) -> Response:
if
isinstance
(
email_list
,
list
):
user_email
=
"
,
"
.
join
(
email_list
)
logger
.
info
(
f
"
get_user_email endpoint retrieved:
{
user_email
}
"
)
# We only send emails to the PI/CoI in production!
email_pi
=
CapoConfig
().
getboolean
(
"
edu.nrao.workspaces.NotificationSettings.sendPIEmail
"
)
if
not
email_pi
:
user_email
=
CapoConfig
().
settings
(
NOTIF_SETTINGS_KEY
).
analystEmail
return
Response
(
status_int
=
http
.
HTTPStatus
.
OK
,
json_body
=
{
"
resp
"
:
f
"
{
user_email
}
"
})
Loading