2021-10-25 13:44:54 +02:00
|
|
|
"""
|
|
|
|
Author: Michel Peltriaux
|
|
|
|
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
|
|
|
|
Contact: michel.peltriaux@sgdnord.rlp.de
|
|
|
|
Created on: 25.10.21
|
|
|
|
|
|
|
|
"""
|
2021-10-25 14:36:58 +02:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
from compensation.utils.quality import CompensationQualityChecker
|
2021-10-25 13:44:54 +02:00
|
|
|
|
|
|
|
|
2021-10-25 14:36:58 +02:00
|
|
|
class EmaQualityChecker(CompensationQualityChecker):
|
2021-10-25 13:44:54 +02:00
|
|
|
def run_check(self):
|
2021-10-25 14:36:58 +02:00
|
|
|
super().run_check()
|
|
|
|
self._check_responsible_data()
|
|
|
|
|
|
|
|
def _check_responsible_data(self):
|
|
|
|
""" Checks on responsible data quality
|
2021-10-25 13:44:54 +02:00
|
|
|
|
|
|
|
Returns:
|
|
|
|
|
|
|
|
"""
|
2021-10-25 14:36:58 +02:00
|
|
|
try:
|
|
|
|
resp = self.obj.responsible
|
|
|
|
if resp.conservation_office is None:
|
|
|
|
self._add_missing_attr_name(_("Conservation office"))
|
|
|
|
if resp.conservation_file_number is None or len(resp.conservation_file_number) == 0:
|
|
|
|
self._add_missing_attr_name(_("Conservation office file number"))
|
|
|
|
except AttributeError:
|
|
|
|
self._add_missing_attr_name(_("Responsible data"))
|