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:
@@ -17,7 +17,7 @@ from codelist.models import KonovaCode
|
||||
from codelist.settings import CODELIST_PROCESS_TYPE_ID, CODELIST_LAW_ID, \
|
||||
CODELIST_REGISTRATION_OFFICE_ID, CODELIST_CONSERVATION_OFFICE_ID
|
||||
from intervention.inputs import GenerateInput
|
||||
from intervention.models import Intervention, LegalData, ResponsibilityData
|
||||
from intervention.models import Intervention, Legal, Responsibility
|
||||
from konova.forms import BaseForm, SimpleGeomForm
|
||||
from user.models import UserActionLogEntry, UserAction
|
||||
|
||||
@@ -220,7 +220,7 @@ class NewInterventionForm(BaseForm):
|
||||
)
|
||||
|
||||
# Create legal data object (without M2M laws first)
|
||||
legal_data = LegalData.objects.create(
|
||||
legal_data = Legal.objects.create(
|
||||
registration_date=registration_date,
|
||||
binding_date=binding_date,
|
||||
process_type=_type,
|
||||
@@ -229,7 +229,7 @@ class NewInterventionForm(BaseForm):
|
||||
legal_data.laws.set(laws)
|
||||
|
||||
# Create responsible data object
|
||||
responsibility_data = ResponsibilityData.objects.create(
|
||||
responsibility_data = Responsibility.objects.create(
|
||||
registration_office=registration_office,
|
||||
conservation_office=conservation_office,
|
||||
registration_file_number=registration_file_number,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user