Skip to content

Commit 95e8e79

Browse files
committed
Extract lines from try
1 parent ca3818f commit 95e8e79

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

app/routers/event.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,14 @@ def delete_event(request: Request,
137137
db.query(UserEvent).filter(UserEvent.event_id == event_id).delete()
138138

139139
db.commit()
140-
if participants and event.start > datetime.now():
141-
pass
142-
# TODO: Send them a cancellation notice
143-
# if the deletion is successful
144-
return RedirectResponse(
145-
url="/calendar", status_code=status.HTTP_200_OK)
140+
146141
except (SQLAlchemyError, TypeError):
147142
return templates.TemplateResponse(
148143
"event/eventview.html", {"request": request, "event_id": event_id},
149144
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR)
145+
if participants and event.start > datetime.now():
146+
pass
147+
# TODO: Send them a cancellation notice
148+
# if the deletion is successful
149+
return RedirectResponse(
150+
url="/calendar", status_code=status.HTTP_200_OK)

0 commit comments

Comments
 (0)