reservations: Fix Reservation.__repr__ being sometimes recursively defined
This commit is contained in:
parent
69defab388
commit
ccc7a595ba
@ -104,6 +104,10 @@ class Reservation(models.Model):
|
|||||||
resources = ", ".join(str(resource) for resource in self.resources.all())
|
resources = ", ".join(str(resource) for resource in self.resources.all())
|
||||||
return f"{resources}: {self.start} - {self.end}"
|
return f"{resources}: {self.start} - {self.end}"
|
||||||
|
|
||||||
|
def __repr__(self) -> str:
|
||||||
|
"""Redefined to avoid __str__ and therefore .resources, which was causing recursion issues"""
|
||||||
|
return f"<{self.__class__.__name__}: {self.start} - {self.end}>"
|
||||||
|
|
||||||
def get_title(self) -> str:
|
def get_title(self) -> str:
|
||||||
return "Unknown Reservation"
|
return "Unknown Reservation"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user