Don't crash when not logged in
This commit is contained in:
parent
cc5e3e3ecd
commit
da7baed79c
1 changed files with 3 additions and 0 deletions
|
@ -36,6 +36,9 @@ class Event(models.Model):
|
|||
|
||||
|
||||
def registration_of(self, user):
|
||||
if not user.is_authenticated:
|
||||
return None
|
||||
|
||||
registrations = self.eventregistration_set.filter(user=user).all()
|
||||
if not registrations:
|
||||
return None
|
||||
|
|
Loading…
Reference in a new issue