diff --git a/konova/forms.py b/konova/forms.py index ced2bf10..67014260 100644 --- a/konova/forms.py +++ b/konova/forms.py @@ -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