Add model attribute for profile completeness
This commit is contained in:
@@ -38,6 +38,15 @@ class User(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
|
||||
"date_latest_training",
|
||||
]
|
||||
|
||||
@property
|
||||
def profile_complete(self):
|
||||
return all(
|
||||
[
|
||||
getattr(self, field_name) is not None
|
||||
for field_name in self.REQUIRED_FIELDS
|
||||
]
|
||||
)
|
||||
|
||||
@property
|
||||
def atat_permissions(self):
|
||||
return self.atat_role.permissions
|
||||
|
Reference in New Issue
Block a user