Fixes and improvements
* moves diff_states message back to table top for direct presentation in compensation/detail/view.html * removes diff_states rendering in deadline card in compensation/detail/view.html * fixes before_state adding based on GET parameter * refactors UserActionlogEntryEnum into a UserAction TextChoice (Django 3.x) * adds ordering of compensation states depending on surface value * refactors ServerMessageImportance from enum into TextChoice (Django 3.x) * adds/updates translations
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import uuid
|
||||
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.contrib.auth.models import User
|
||||
from django.db import models
|
||||
|
||||
from konova.enums import UserActionLogEntryEnum
|
||||
from user.enums import UserNotificationEnum
|
||||
|
||||
|
||||
@@ -41,6 +41,16 @@ class KonovaUserExtension(models.Model):
|
||||
notifications = models.ManyToManyField(UserNotification, related_name="+")
|
||||
|
||||
|
||||
class UserAction(models.TextChoices):
|
||||
"""
|
||||
Defines different possible user actions for UserActionLogEntry
|
||||
"""
|
||||
CHECKED = "checked", _("Checked")
|
||||
RECORDED = "recorded", _("Recorded")
|
||||
CREATED = "created", _("Created")
|
||||
DELETED = "deleted", _("Deleted")
|
||||
|
||||
|
||||
class UserActionLogEntry(models.Model):
|
||||
""" Wraps a user action log entry
|
||||
|
||||
@@ -58,7 +68,7 @@ class UserActionLogEntry(models.Model):
|
||||
null=True,
|
||||
blank=True,
|
||||
help_text="Short name for performed action - optional",
|
||||
choices=UserActionLogEntryEnum.as_choices(drop_empty_choice=True),
|
||||
choices=UserAction.choices,
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
|
||||
Reference in New Issue
Block a user