Recording data

* adds dynamic icon for recording and unrecording of data
* adds record view to intervention and eco accounts
* adds quality_check() method for Intervention and EcoAccount class which holds logic for data quality checking
* adds UserAction "unrecorded"
This commit is contained in:
mipel
2021-08-10 17:19:42 +02:00
parent 76bda648d0
commit c95e451520
15 changed files with 291 additions and 122 deletions
+7 -3
View File
@@ -408,9 +408,13 @@ class RunCheckForm(BaseModalForm):
def is_valid(self):
super_result = super().is_valid()
# Perform check
result, msgs = self.instance.check_validity()
self.errors.update(msgs)
return result & super_result
msgs = self.instance.quality_check()
for msg in msgs:
self.add_error(
"checked_intervention",
msg
)
return super_result and (len(msgs) == 0)
def save(self):
with transaction.atomic():