Fix erreur 500 si pas d'alias

This commit is contained in:
Jean-Marie Favreau 2024-05-01 15:23:06 +02:00
parent 94cc66e3f2
commit 22c895b3a2

View File

@ -209,7 +209,10 @@ class Place(models.Model):
return Event.objects.filter(exact_location=self).count() return Event.objects.filter(exact_location=self).count()
def match(self, event): def match(self, event):
if self.aliases:
return event.location in self.aliases return event.location in self.aliases
else:
return False
def associate_matching_events(self): def associate_matching_events(self):
u_events = Event.objects.filter(exact_location__isnull=True) u_events = Event.objects.filter(exact_location__isnull=True)