Merge pull request 'Fix' (#196) from 192_Deduction_modal_form_on_recorded_intervention into master

Reviewed-on: SGD-Nord/konova#196
This commit is contained in:
mpeltriaux 2022-08-10 09:29:18 +02:00
commit f9c23a8f29

View File

@ -15,6 +15,7 @@ from django.contrib import messages
from django.contrib.gis import gdal
from django.db.models.fields.files import FieldFile
from compensation.models import EcoAccount
from konova.sub_settings.lanis_settings import DEFAULT_SRID_RLP
from user.models import User
from django.contrib.gis.forms import MultiPolygonField
@ -156,16 +157,16 @@ class BaseForm(forms.Form):
RemoveEcoAccountDeductionModalForm
is_none = self.instance is None
is_other_data_type = not isinstance(self.instance, BaseObject)
is_deduction_form = isinstance(
is_deduction_form_from_account = isinstance(
self,
(
NewDeductionModalForm,
EditEcoAccountDeductionModalForm,
RemoveEcoAccountDeductionModalForm,
)
)
) and isinstance(self.instance, EcoAccount)
if is_none or is_other_data_type or is_deduction_form:
if is_none or is_other_data_type or is_deduction_form_from_account:
# Do nothing
return