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:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user