Enhance user identifier formatting and improve user organization display with titles

This commit is contained in:
Yaro Kasear 2025-07-28 08:32:01 -05:00
parent cd834e768d
commit 7594b66520
4 changed files with 62 additions and 26 deletions

View file

@ -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,