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 816600535a
commit cd5b2e264b
17 changed files with 215 additions and 164 deletions

View File

@@ -15,13 +15,12 @@ from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from intervention.models import Intervention
from konova.enums import UserActionLogEntryEnum
from konova.forms import BaseForm, BaseModalForm
from konova.models import Document
from konova.settings import DEFAULT_LAT, DEFAULT_LON, DEFAULT_ZOOM, ZB_GROUP, ETS_GROUP
from konova.utils.user_checks import in_group
from organisation.models import Organisation
from user.models import UserActionLogEntry
from user.models import UserActionLogEntry, UserAction
class NewInterventionForm(BaseForm):
@@ -120,7 +119,7 @@ class NewInterventionForm(BaseForm):
action = UserActionLogEntry.objects.create(
user=user,
action=UserActionLogEntryEnum.CREATED.value,
action=UserAction.CREATED,
)
intervention = Intervention(
identifier=identifier,

View File

@@ -12,12 +12,11 @@ from django.utils import timezone
from django.utils.timezone import now
from intervention.settings import INTERVENTION_IDENTIFIER_LENGTH, INTERVENTION_IDENTIFIER_TEMPLATE
from konova.enums import UserActionLogEntryEnum
from konova.models import BaseObject, Geometry, UuidModel
from konova.utils import generators
from konova.utils.generators import generate_random_string
from organisation.models import Organisation
from user.models import UserActionLogEntry
from user.models import UserActionLogEntry, UserAction
class ResponsibilityData(UuidModel):
@@ -139,7 +138,7 @@ class Intervention(BaseObject):
action = UserActionLogEntry.objects.create(
user=_user,
timestamp=_now,
action=UserActionLogEntryEnum.DELETED.value
action=UserAction.DELETED
)
for com in coms:
com.deleted = action