Skip to content
Snippets Groups Projects
Commit 70460c82 authored by GraceDB's avatar GraceDB Committed by GraceDB
Browse files

Update confirm_superevent_as_gw utility method

Added some information about old/new IDs to the log message which
is created when a superevent is "upgraded" to a GW.
parent d94f9e11
No related branches found
No related tags found
No related merge requests found
......@@ -480,18 +480,20 @@ def get_superevent_by_date_id_or_404(superevent_id, queryset=None):
def confirm_superevent_as_gw(superevent, user, add_log_message=True,
issue_alert=True):
# Save old ID temporarily
old_id = superevent.superevent_id
# Update superevent (mark as a GW, construct new ID, etc.)
superevent.confirm_as_gw()
# Create log message
gw_log = None
if add_log_message:
message = "Confirmed as a gravitational wave."
message = ("Confirmed as a gravitational wave: ID changed from "
"{old} -> {new}").format(old=old_id, new=superevent.superevent_id)
gw_log = create_log(user, message, superevent, issue_alert=issue_alert,
autogenerated=False)
# TODO: add label?
return gw_log
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment