fix: Remove enum contains for 3.11 compat.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user