Fix UserRank not being translatable

This commit is contained in:
rubenwardy
2024-06-08 12:27:05 +01:00
parent 7cf1f40ff6
commit e335797629
9 changed files with 35 additions and 13 deletions

View File

@@ -71,12 +71,13 @@ class AuditSeverity(enum.Enum):
def __str__(self):
return self.name
def get_title(self):
@property
def title(self):
return self.name.replace("_", " ").title()
@classmethod
def choices(cls):
return [(choice, choice.get_title()) for choice in cls]
return [(choice, choice.title) for choice in cls]
@classmethod
def coerce(cls, item):