Intervention forms

* refactors intervention/forms and ../modalForms into individual files in separated packages
    * forms.py has been renamed into intervention.py, now can be found as intervention/forms/intervention.py
    * modalForms.py has been split into individual files living in modals package, can be found as intervention/forms/modals/...
This commit is contained in:
2022-08-18 10:08:51 +02:00
parent 1367fd2b5f
commit de8d79983d
13 changed files with 641 additions and 585 deletions
+9 -5
View File
@@ -4,10 +4,14 @@ from django.utils.translation import gettext_lazy as _
from django.http import HttpRequest, JsonResponse, Http404
from django.shortcuts import render
from intervention.forms.forms import NewInterventionForm, EditInterventionForm
from intervention.forms.modalForms import ShareModalForm, NewRevocationModalForm, \
CheckModalForm, NewDeductionModalForm, NewInterventionDocumentModalForm, RemoveEcoAccountDeductionModalForm, \
RemoveRevocationModalForm, EditEcoAccountDeductionModalForm, EditRevocationModalForm
from intervention.forms.intervention import NewInterventionForm, EditInterventionForm
from intervention.forms.modals.check import CheckModalForm
from intervention.forms.modals.deduction import NewEcoAccountDeductionModalForm, RemoveEcoAccountDeductionModalForm, \
EditEcoAccountDeductionModalForm
from intervention.forms.modals.document import NewInterventionDocumentModalForm
from intervention.forms.modals.revocation import EditRevocationModalForm, RemoveRevocationModalForm, \
NewRevocationModalForm
from intervention.forms.modals.share import ShareModalForm
from intervention.models import Intervention, Revocation, InterventionDocument, RevocationDocument
from intervention.tables import InterventionTable
from konova.contexts import BaseContext
@@ -583,7 +587,7 @@ def new_deduction_view(request: HttpRequest, id: str):
"""
intervention = get_object_or_404(Intervention, id=id)
form = NewDeductionModalForm(request.POST or None, instance=intervention, request=request)
form = NewEcoAccountDeductionModalForm(request.POST or None, instance=intervention, request=request)
return form.process_request(
request,
msg_success=DEDUCTION_ADDED,