mirror of
https://github.com/enpaul/keyosk.git
synced 2024-11-24 23:47:49 +00:00
!fixup Add access_list_names property back to domain model
This commit is contained in:
parent
d6265c4797
commit
31845ef7c5
@ -53,6 +53,11 @@ class Domain(KeyoskBaseModel):
|
||||
_lifespan_access = peewee.IntegerField(null=False)
|
||||
_lifespan_refresh = peewee.IntegerField(null=False)
|
||||
|
||||
@property
|
||||
def access_list_names(self) -> List[str]:
|
||||
"""Return the list of access list names"""
|
||||
return [item.name for item in self.access_lists]
|
||||
|
||||
@property
|
||||
def lifespan_access(self) -> datetime.timedelta:
|
||||
"""Return the access lifespan as a timedelta"""
|
||||
@ -90,13 +95,13 @@ class Domain(KeyoskBaseModel):
|
||||
"enable_refresh",
|
||||
"lifespan_access",
|
||||
"lifespan_refresh",
|
||||
"access_lists",
|
||||
"access_list_names",
|
||||
"permissions",
|
||||
]
|
||||
|
||||
@staticmethod
|
||||
def foreign_backref() -> List[str]:
|
||||
return ["access_lists", "permissions"]
|
||||
return ["permissions"]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"Domain '{self.name}' ({self.uuid})"
|
||||
|
Loading…
Reference in New Issue
Block a user