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:
mipel
2021-08-03 17:22:41 +02:00
parent 881edaeba6
commit 04db4e4e7f
17 changed files with 215 additions and 164 deletions
+4 -9
View File
@@ -21,10 +21,9 @@ from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from konova.contexts import BaseContext
from konova.enums import UserActionLogEntryEnum
from konova.models import Document
from konova.utils.message_templates import FORM_INVALID
from user.models import UserActionLogEntry
from user.models import UserActionLogEntry, UserAction
class BaseForm(forms.Form):
@@ -117,11 +116,9 @@ class RemoveForm(BaseForm):
action = UserActionLogEntry.objects.create(
user=user,
timestamp=timezone.now(),
action=UserActionLogEntryEnum.DELETED.value
action=UserAction.DELETED
)
self.object_to_remove.deleted = action
#self.object_to_remove.deleted_on = timezone.now()
#self.object_to_remove.deleted_by = user
self.object_to_remove.save()
return self.object_to_remove
@@ -229,11 +226,9 @@ class RemoveModalForm(BaseModalForm):
action = UserActionLogEntry.objects.create(
user=self.user,
timestamp=timezone.now(),
action=UserActionLogEntryEnum.DELETED.value,
action=UserAction.DELETED,
)
self.instance.deleted = action
#self.instance.deleted_on = timezone.now()
#self.instance.deleted_by = self.user
self.instance.save()
else:
# If the class does not provide restorable delete functionality, we must delete the entry finally
@@ -297,7 +292,7 @@ class NewDocumentForm(BaseModalForm):
with transaction.atomic():
action = UserActionLogEntry.objects.create(
user=self.user,
action=UserActionLogEntryEnum.CREATED.value,
action=UserAction.CREATED,
)
doc = Document.objects.create(
created=action,