#86 Userlogs Compensation

* adds log details for adding/removing of compensations for intervention
* adds handy restore-deleted function for admin backend for alls BaseObject derivatives
* adds/updates translations
This commit is contained in:
2022-02-03 15:29:22 +01:00
parent e5cd5a2312
commit 6c80480d0d
10 changed files with 231 additions and 160 deletions

View File

@@ -20,7 +20,7 @@ from compensation.utils.quality import CompensationQualityChecker
from konova.models import BaseObject, AbstractDocument, Deadline, generate_document_file_upload_path, \
GeoReferencedMixin
from konova.settings import DEFAULT_SRID_RLP, LANIS_LINK_TEMPLATE
from konova.utils.message_templates import DATA_UNSHARED_EXPLANATION
from konova.utils.message_templates import DATA_UNSHARED_EXPLANATION, COMPENSATION_REMOVED_TEMPLATE
from user.models import UserActionLogEntry
@@ -235,6 +235,11 @@ class Compensation(AbstractCompensation, CEFMixin, CoherenceMixin):
self.identifier = self.generate_new_identifier()
super().save(*args, **kwargs)
def mark_as_deleted(self, user, send_mail: bool = True):
super().mark_as_deleted(user, send_mail)
if user is not None:
self.intervention.mark_as_edited(user, edit_comment=COMPENSATION_REMOVED_TEMPLATE.format(self.identifier))
def is_shared_with(self, user: User):
""" Access check