[EcoAccount] See recorded state of withdraw #6

* adds prefiltering of withdraws --> excludes withdraws of as deleted flagged interventions
* renders intervention-recorded icon into eco account withdraws details view
* fixes bug in case of document deleting which does not contain any files
* renames RecordForm into RecordModalForm for more clarity
This commit is contained in:
mipel
2021-08-26 15:45:24 +02:00
parent 6655ed1f57
commit 8f641daee4
8 changed files with 46 additions and 15 deletions
+14 -1
View File
@@ -7,10 +7,12 @@ Created on: 17.11.20
"""
from django.contrib.auth.models import User
from django.contrib.gis.db import models
from django.utils.timezone import localtime
from django.utils.translation import gettext_lazy as _
from konova.models import BaseObject, Geometry, UuidModel, BaseResource
from konova.settings import DEFAULT_SRID_RLP, LANIS_LINK_TEMPLATE
from konova.sub_settings.django_settings import DEFAULT_DATE_TIME_FORMAT
from konova.utils import generators
from organisation.models import Organisation
from user.models import UserActionLogEntry
@@ -45,7 +47,8 @@ class Revocation(BaseResource):
def delete(self):
# Make sure related objects are being removed as well
self.document.delete()
if self.document:
self.document.delete()
super().delete()
@@ -248,3 +251,13 @@ class Intervention(BaseObject):
x,
y,
)
@property
def recorded_tooltip(self):
tooltip = _("Not recorded yet")
if self.recorded:
value = self.recorded.timestamp
value = localtime(value)
on = value.strftime(DEFAULT_DATE_TIME_FORMAT)
tooltip = _("Recorded on {} by {}").format(on, self.recorded.user)
return tooltip