Enhance user identifier formatting and improve user organization display with titles
This commit is contained in:
parent
cd834e768d
commit
7594b66520
4 changed files with 62 additions and 26 deletions
|
@ -33,7 +33,7 @@ class User(db.Model, ImageAttachable):
|
|||
|
||||
@property
|
||||
def identifier(self) -> str:
|
||||
return f"{self.first_name or ''} {self.last_name or ''}".strip()
|
||||
return f"{self.first_name or ''} {self.last_name or ''}{', ' + (''.join(word[0].upper() for word in self.title.split())) if self.title else ''}".strip()
|
||||
|
||||
def __init__(self, first_name: Optional[str] = None, last_name: Optional[str] = None,
|
||||
title: Optional[str] = None,location_id: Optional[int] = None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue