#36 Quality checks

* moves geometry check logic to upper class
This commit is contained in:
mpeltriaux 2021-10-25 13:21:27 +02:00
parent a5b1f68f62
commit 4c7efdb800
2 changed files with 12 additions and 13 deletions

View File

@ -97,16 +97,3 @@ class InterventionQualityChecker(AbstractQualityChecker):
self.messages.append( self.messages.append(
_("No compensation of any type found (Compensation, Payment, Deduction)") _("No compensation of any type found (Compensation, Payment, Deduction)")
) )
def _check_geometry(self):
""" Checks on the geometry
Returns:
"""
try:
geometry_obj = self.obj.geometry
if geometry_obj.geom.empty:
self._add_missing_attr_name(_("Geometry"))
except AttributeError:
self._add_missing_attr_name(_("Geometry"))

View File

@ -32,3 +32,15 @@ class AbstractQualityChecker:
missing = _('missing') missing = _('missing')
self.messages.append(f"{attr_name} {missing}") self.messages.append(f"{attr_name} {missing}")
def _check_geometry(self):
""" Checks on the geometry
Returns:
"""
try:
geometry_obj = self.obj.geometry
if geometry_obj.geom.empty:
self._add_missing_attr_name(_("Geometry"))
except AttributeError:
self._add_missing_attr_name(_("Geometry"))