From d83709d2c2b9df37f3f4b1df15ce38c9ce9c815a Mon Sep 17 00:00:00 2001 From: Interitio Date: Tue, 10 Jun 2025 23:20:13 +1000 Subject: [PATCH] fix: Remove enum contains for 3.11 compat. --- src/routes/events.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)