Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GraceDB Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael Coughlin
GraceDB Server
Commits
1420ab08
Commit
1420ab08
authored
6 years ago
by
Tanner Prestegard
Committed by
GraceDB
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Adding alerts for exposing/hiding a superevent
parent
721a6b9c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gracedb/alerts/superevent_utils.py
+21
-1
21 additions, 1 deletion
gracedb/alerts/superevent_utils.py
with
21 additions
and
1 deletion
gracedb/alerts/superevent_utils.py
+
21
−
1
View file @
1420ab08
...
...
@@ -8,7 +8,7 @@ from rest_framework.renderers import JSONRenderer
from
api.v1.superevents.serializers
import
SupereventSerializer
,
\
SupereventLogSerializer
,
SupereventLabelSerializer
,
\
SupereventEMObservationSerializer
,
SupereventVOEventSerializer
,
\
SupereventSignoffSerializer
SupereventSignoffSerializer
,
SupereventGroupObjectPermissionSerializer
from
core.urls
import
build_absolute_uri
from
superevents.shortcuts
import
is_superevent
from
.main
import
issue_alerts
...
...
@@ -158,3 +158,23 @@ def issue_alert_for_superevent_signoff(signoff, request=None):
# Send alerts
issue_alerts
(
signoff
.
superevent
,
alert_type
=
"
signoff
"
,
url
=
url
,
description
=
description
,
serialized_object
=
serialized_object
)
def
issue_alert_for_superevent_permissions
(
superevent
,
request
=
None
):
# Construct URL for web view
url
=
build_absolute_uri
(
reverse
(
'
superevents:view
'
,
args
=
[
superevent
.
superevent_id
]),
request
)
# Get serialized permissions
gops
=
superevent
.
supereventgroupobjectpermission_set
.
all
()
gop_group_pks
=
gops
.
values_list
(
'
group
'
,
flat
=
True
).
distinct
()
group_queryset
=
AuthGroup
.
objects
.
filter
(
pk__in
=
gop_group_pks
)
serialized_list
=
SupereventGroupObjectPermissionSerializer
(
group_queryset
,
many
=
True
)
# Description
description
=
'
Permissions updated
'
# Send alerts
issue_alerts
(
superevent
,
alert_type
=
"
update
"
,
url
=
url
,
description
=
description
,
serialized_object
=
serialized_list
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment