Refactors triggering checked/recorded

* refactors BaseForm request/user initialization
* introduces mark_as_edited() method for compensation models
This commit is contained in:
2021-11-17 14:33:05 +01:00
parent 4583a9f826
commit 122c9cb363
18 changed files with 328 additions and 308 deletions

View File

@@ -46,7 +46,7 @@ def remove_document(request: HttpRequest, doc: AbstractDocument):
"""
title = doc.title
form = RemoveModalForm(request.POST or None, instance=doc, user=request.user)
form = RemoveModalForm(request.POST or None, instance=doc, request=request)
return form.process_request(
request=request,
msg_success=_("Document '{}' deleted").format(title)

View File

@@ -19,4 +19,10 @@ MISSING_GROUP_PERMISSION = _("You need to be part of another user group.")
CHECKED_RECORDED_RESET = _("Status of Checked and Recorded reseted")
# ECO ACCOUNT
CANCEL_ACC_RECORDED_OR_DEDUCTED = _("Action canceled. Eco account is recorded or deductions exist. Only conservation office member can perform this action.")
CANCEL_ACC_RECORDED_OR_DEDUCTED = _("Action canceled. Eco account is recorded or deductions exist. Only conservation office member can perform this action.")
# Edited
EDITED_GENERAL_DATA = _("Edited general data")
ADDED_COMPENSATION_STATE = _("Added compensation state")
ADDED_DEADLINE = _("Added deadline")
ADDED_COMPENSATION_ACTION = _("Added compensation action")