From a6a1b4d935b53c586023d1fa4013b0d3630463ed Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Tue, 22 May 2018 17:11:20 -0400 Subject: [PATCH] Throw a 404 error instead of 500 when somebody tries to attend an event that doesn't exist --- get_together/views/events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/get_together/views/events.py b/get_together/views/events.py index 35be0dc..2d205f8 100644 --- a/get_together/views/events.py +++ b/get_together/views/events.py @@ -417,7 +417,7 @@ def contact_attendee(attendee, body, sender): def attend_event(request, event_id): - event = Event.objects.get(id=event_id) + event = get_object_or_404(Event, id=event_id) if request.user.is_anonymous: messages.add_message(request, messages.WARNING, message=_("You must be logged in to say you're attending.")) return redirect(event.get_absolute_url())