diff --git a/reservations/models.py b/reservations/models.py index 1c25ad6..fa436c4 100644 --- a/reservations/models.py +++ b/reservations/models.py @@ -101,7 +101,10 @@ class Reservation(models.Model): ] def __str__(self) -> str: - resources = ", ".join(str(resource) for resource in self.resources.all()) + try: + resources = ", ".join(str(resource) for resource in self.resources.all()) + except ValueError: + resources = "no resources" return f"{resources}: {self.start} - {self.end}" def __repr__(self) -> str: