Refactoring

* renames model ResponsibilityData into Responsibility
* renames model LegalData into Legal
* moves form->object saving logic into model
* refactors NewDocumentForm into special types for intervention, compensation, eco account and ema
*
This commit is contained in:
2021-11-15 17:09:17 +01:00
parent 0778277de4
commit bcffae4a95
17 changed files with 220 additions and 155 deletions

View File

@@ -14,8 +14,8 @@ from django.utils.translation import gettext_lazy as _
from compensation.models import EcoAccount, EcoAccountDeduction
from intervention.inputs import TextToClipboardInput
from intervention.models import Revocation, RevocationDocument, Intervention
from konova.forms import BaseModalForm
from intervention.models import Revocation, RevocationDocument, Intervention, InterventionDocument
from konova.forms import BaseModalForm, NewDocumentForm
from konova.utils.general import format_german_float
from konova.utils.messenger import Messenger
from konova.utils.user_checks import is_default_group_only
@@ -409,4 +409,8 @@ class NewDeductionModalForm(BaseModalForm):
surface=self.cleaned_data["surface"],
created=user_action_create,
)
return deduction
return deduction
class NewInterventionDocumentForm(NewDocumentForm):
document_model = InterventionDocument