# 86 More log details Documents

* adds more log details on adding/removing documents
* fixes bug in admin backend where restoring of non-compensation entries led to an error
* fixes bug where deleting of revocation without an attached file would lead to an error
This commit is contained in:
2022-02-04 09:18:46 +01:00
parent 0a6d5cf19b
commit 298a632cac
13 changed files with 56 additions and 26 deletions

View File

@@ -10,6 +10,7 @@ from django.utils.translation import gettext_lazy as _
from konova.forms import RemoveModalForm
from konova.models import AbstractDocument
from konova.utils.message_templates import DOCUMENT_REMOVED_TEMPLATE
def get_document(doc: AbstractDocument):
@@ -49,5 +50,5 @@ def remove_document(request: HttpRequest, doc: AbstractDocument):
form = RemoveModalForm(request.POST or None, instance=doc, request=request)
return form.process_request(
request=request,
msg_success=_("Document '{}' deleted").format(title)
msg_success=DOCUMENT_REMOVED_TEMPLATE.format(title)
)

View File

@@ -37,6 +37,10 @@ PAYMENT_REMOVED = _("Payment removed")
REVOCATION_ADDED = _("Revocation added")
REVOCATION_REMOVED = _("Revocation removed")
# DOCUMENTS
DOCUMENT_REMOVED_TEMPLATE = _("Document '{}' deleted")
DOCUMENT_ADDED = _("Document added")
# Edited
EDITED_GENERAL_DATA = _("Edited general data")
ADDED_COMPENSATION_STATE = _("Added compensation state")