Throw a 404 error instead of 500 when somebody tries to attend an event that doesn't exist
This commit is contained in:
parent
a05889bd76
commit
a6a1b4d935
1 changed files with 1 additions and 1 deletions
|
@ -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())
|
||||
|
|
Loading…
Reference in a new issue