perf: ticket action (#9090)

Co-authored-by: feng <1304903146@qq.com>
This commit is contained in:
fit2bot
2022-11-17 15:07:23 +08:00
committed by GitHub
parent 73c2155864
commit 3a62abf381
4 changed files with 10 additions and 2 deletions

View File

@@ -32,3 +32,7 @@ class ActionChoices(BitChoices):
def has_perm(cls, action_name, total):
action_value = getattr(cls, action_name)
return action_value & total == action_value
@classmethod
def display(cls, value):
return ', '.join([c.label for c in cls if c.value & value == c.value])