Fix
* adds more detailed situation check on check_for_recorded_instance()
This commit is contained in:
parent
b5333baa86
commit
45e9ff9539
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user