reservations: Don't error out when Reservation.resources not yet ready
This commit is contained in:
parent
b3a7ef8232
commit
bccbc04f87
@ -101,7 +101,10 @@ class Reservation(models.Model):
|
|||||||
]
|
]
|
||||||
|
|
||||||
def __str__(self) -> str:
|
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}"
|
return f"{resources}: {self.start} - {self.end}"
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user