diff --git a/src/routes/events.py b/src/routes/events.py index 4e32ae0..8e55797 100644 --- a/src/routes/events.py +++ b/src/routes/events.py @@ -72,7 +72,7 @@ class Event: conds.append(EventD.occurred_at >= after) if event_type is not None: ekey = (event_type.lower().strip(),) - if ekey not in EventType: + if ekey not in [e.value for e in EventType]: raise web.HTTPBadRequest(text=f"Unknown event type '{event_type}'") conds.append(EventD.event_type == EventType(ekey)) @@ -85,7 +85,7 @@ class Event: raise web.HTTPBadRequest(text="Event creation missing required field 'event_type'.") ekey = (params['event_type'].lower().strip(),) - if ekey not in EventType: + if ekey not in [e.value for e in EventType]: raise web.HTTPBadRequest(text=f"Unknown event type '{params['event_type']}'") event_type = EventType(ekey) @@ -128,7 +128,7 @@ class Event: # EventD = data.EventDetails ekey = (kwargs['event_type'].lower().strip(),) - if ekey not in EventType: + if ekey not in [e.value for e in EventType]: raise web.HTTPBadRequest(text=f"Unknown event type '{kwargs['event_type']}'") event_type = EventType(ekey)