Fix str
This commit is contained in:
parent
293c2a0aa7
commit
22ac627f17
1 changed files with 6 additions and 1 deletions
|
@ -37,7 +37,12 @@ class FriendLocation(BaseModel):
|
||||||
return str(self.longitude)
|
return str(self.longitude)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f'{self.friend.get_display_name()} from {self.start_date} to {self.end_date}'
|
result = f'{self.friend.get_display_name()}'
|
||||||
|
if self.start_date:
|
||||||
|
result += f' from {self.start_date}'
|
||||||
|
if self.end_date:
|
||||||
|
result += f' until {self.end_date}'
|
||||||
|
return result
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def safe_html(self):
|
def safe_html(self):
|
||||||
|
|
Loading…
Reference in a new issue