diff --git a/src/agenda_culturel/models.py b/src/agenda_culturel/models.py index 5057b9b..90b9e7f 100644 --- a/src/agenda_culturel/models.py +++ b/src/agenda_culturel/models.py @@ -209,7 +209,10 @@ class Place(models.Model): return Event.objects.filter(exact_location=self).count() def match(self, event): - return event.location in self.aliases + if self.aliases: + return event.location in self.aliases + else: + return False def associate_matching_events(self): u_events = Event.objects.filter(exact_location__isnull=True)