diff --git a/events/models.py b/events/models.py index 4f4fcf4..1196c99 100644 --- a/events/models.py +++ b/events/models.py @@ -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