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
1 changed files with 4 additions and 1 deletions

View File

@ -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)