Jul 17 - Fill the gaps between Single-tenant mode and Multi-tenant mode - MT5
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user