#7 New Form
* adds NewCompensationForm content and functionality * renames CODELIST_COMPENSATION_COMBINATION_ID into CODELIST_COMPENSATION_FUNDING_ID for more clarity * reorganizes compensation forms into compensation/forms/forms.py and forms/modalForms.py * adds new compensation html template in compensation/templates/compensation/new * adds new default message template in message_templates.py: IDENTIFIER_REPLACED * adds/updates translations
This commit is contained in:
@@ -13,7 +13,7 @@ from konova.decorators import *
|
||||
from konova.forms import SimpleGeomForm, NewDocumentForm, RemoveModalForm, RecordModalForm
|
||||
from konova.sub_settings.django_settings import DEFAULT_DATE_FORMAT
|
||||
from konova.utils.documents import remove_document, get_document
|
||||
from konova.utils.message_templates import INTERVENTION_INVALID, FORM_INVALID
|
||||
from konova.utils.message_templates import INTERVENTION_INVALID, FORM_INVALID, IDENTIFIER_REPLACED
|
||||
from konova.utils.user_checks import in_group
|
||||
|
||||
|
||||
@@ -68,13 +68,13 @@ def new_view(request: HttpRequest):
|
||||
if generated_identifier != intervention.identifier:
|
||||
messages.info(
|
||||
request,
|
||||
_("The identifier '{}' had to be changed to '{}' since another entry has been added in the meanwhile, which uses this identifier").format(
|
||||
IDENTIFIER_REPLACED.format(
|
||||
generated_identifier,
|
||||
intervention.identifier
|
||||
)
|
||||
)
|
||||
messages.success(request, _("Intervention {} added").format(intervention.identifier))
|
||||
return redirect("intervention:index")
|
||||
return redirect("intervention:open", id=intervention.id)
|
||||
else:
|
||||
messages.error(request, FORM_INVALID)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user