Jul 17 - Fill the gaps between Single-tenant mode and Multi-tenant mode - MT5

This commit is contained in:
2026-07-17 12:30:04 -04:00
parent d44d761706
commit 8d9730e3df
5 changed files with 240 additions and 0 deletions
+14
View File
@@ -116,6 +116,20 @@ class Issue(db.Model):
"""Return True if the given user is currently following this issue."""
return self.followers.filter_by(user_id=user.id).first() is not None
# Display labels for handler_type. The web templates hardcode these inline;
# this mapping exists so the mobile API can return a human-readable label
# without the client duplicating the strings. (phase43 / MT-5)
HANDLER_LABELS = {
'internal': 'Janitorial Staff',
'facility': 'Facility Staff',
'vendor': 'External Vendor',
}
@property
def handler_label(self):
"""Human-readable label for handler_type; defaults to internal."""
return self.HANDLER_LABELS.get(self.handler_type or 'internal', 'Janitorial Staff')
@property
def resolved_facility(self):
"""Returns the Facility for this issue regardless of which path was used to create it.