Skip to content
Snippets Groups Projects
Commit a129d870 authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB
Browse files

Bugfix for superevent VOEvents

Since we use the preferred event to construct much of the VOEvent
for a superevent, we have to select the event's subclass (note that this
is done for events by the event_and_auth_required decorator, which calls
Event.getByGraceid).  This was preventing certain subclass-specific
attributes from being added to the VOEvents, like ProbHasNS,
ProbHasRemnant, etc.
parent 416ad065
No related branches found
No related tags found
1 merge request!8Superevents
......@@ -51,6 +51,15 @@ def construct_voevent_file(superevent, voevent, request=None,
# Set preferred_event as event to be used in most of this
event = superevent.preferred_event
# Get the event subclass (CoincInspiralEvent, MultiBurstEvent, etc.) and
# set that as the event
subclass_fields = [f for f in event.__class__._meta.get_fields()
if (f.one_to_one and f.auto_created and not f.concrete and
event.__class__ in f.related_model.__bases__)]
for f in subclass_fields:
if hasattr(event, f.name):
event = getattr(event, f.name)
break
# Let's convert that voevent_type to something nicer looking
voevent_type = VOEVENT_TYPE_DICT[voevent.voevent_type]
......
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