Skip to content
Snippets Groups Projects

Add data check system

Merged Jonathan Weth requested to merge feature/data-checks into master
1 file
+ 11
0
Compare changes
  • Side-by-side
  • Inline
import logging
from django.contrib.contenttypes.models import ContentType
from django.db.models.aggregates import Count
from django.utils.translation import gettext as _
@@ -44,6 +45,16 @@ class DataCheck:
with reversion.create_revision():
cls.solve_options[solve_option].solve(check_result)
@classmethod
def register_result(cls, instance) -> "DataCheckResult":
from aleksis.core.models import DataCheckResult
ct = ContentType.objects.get_for_model(instance)
result = DataCheckResult.objects.get_or_create(
check=cls.name, content_type=ct, object_id=instance.id
)
return result
class DataCheckRegistry:
def __init__(self):
Loading