#86 Userlogs Revocation
* reworks user logs for adding/removing revocations with more detail on log history * enhances css to display neat shadow on select2-results
This commit is contained in:
@@ -10,6 +10,7 @@ import shutil
|
||||
|
||||
from django.contrib.gis.db import models
|
||||
from konova.models import BaseResource, AbstractDocument, generate_document_file_upload_path
|
||||
from konova.utils.message_templates import REVOCATION_REMOVED
|
||||
|
||||
|
||||
class Revocation(BaseResource):
|
||||
@@ -20,10 +21,14 @@ class Revocation(BaseResource):
|
||||
legal = models.ForeignKey("Legal", null=False, blank=False, on_delete=models.CASCADE, help_text="Refers to 'Widerspruch am'", related_name="revocations")
|
||||
comment = models.TextField(null=True, blank=True)
|
||||
|
||||
def delete(self, *args, **kwargs):
|
||||
def delete(self, user = None, *args, **kwargs):
|
||||
# Make sure related objects are being removed as well
|
||||
if self.document:
|
||||
self.document.delete(*args, **kwargs)
|
||||
|
||||
if user is not None:
|
||||
self.legal.intervention.mark_as_edited(user, edit_comment=REVOCATION_REMOVED)
|
||||
|
||||
super().delete()
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user