From 745c030cbdc51208232ff5eba6c6dd264b90aedf Mon Sep 17 00:00:00 2001 From: Sundaram Dubey <56407566+maze-runnar@users.noreply.github.com> Date: Fri, 4 Dec 2020 17:43:51 +0530 Subject: [PATCH] fix: handle if there is no event (#7490) Co-authored-by: Areeb Jamal --- app/api/events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/events.py b/app/api/events.py index a679f5fa46..a730d55f9c 100644 --- a/app/api/events.py +++ b/app/api/events.py @@ -656,7 +656,7 @@ def before_get_object(self, view_kwargs): view_kwargs['id'] = None def after_get_object(self, event, view_kwargs): - if event.state == "draft": + if event and event.state == "draft": if not is_logged_in() or not has_access('is_coorganizer', event_id=event.id): raise ObjectNotFound({'parameter': '{id}'}, "Event: not found")