Skip to content

Commit

Permalink
Merge pull request #874 from amakarudze/fix-818
Browse files Browse the repository at this point in the history
Fix Event.MultipleObjectsReturn on ... /apply/
  • Loading branch information
amakarudze authored Mar 27, 2023
2 parents 39f7af2 + 0333a97 commit 178ad8f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def get_event(page_url, is_user_authenticated, is_preview):
event = Event.objects.get(page_url=page_url)
except Event.DoesNotExist:
return None
except Event.MultipleObjectsReturned:
event = Event.objects.filter(page_url=page_url).first()

if not (is_user_authenticated or is_preview) and not event.is_page_live:
past = event.date <= now_approx
Expand Down

0 comments on commit 178ad8f

Please sign in to comment.