Skip to content
Snippets Groups Projects
Verified Commit 407d3ab4 authored by Jonathan Weth's avatar Jonathan Weth :keyboard: Committed by Nik | Klampfradler
Browse files

Use a set for the data check registry to prevent double entries

parent e36c64ef
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,7 @@ Fixed
~~~~~
* Fix installation documentation (nginx, uWSGI).
* Use a set for data checks registry to prevent double entries.
Removed
~~~~~~~
......
......@@ -74,9 +74,9 @@ class CoreConfig(AppConfig):
"""Get all data checks from all loaded models."""
from aleksis.core.data_checks import DataCheckRegistry
data_checks = []
data_checks = set()
for model in apps.get_models():
data_checks += getattr(model, "data_checks", [])
data_checks.update(getattr(model, "data_checks", []))
DataCheckRegistry.data_checks = data_checks
def preference_updated(
......
......@@ -225,7 +225,7 @@ class DataCheck:
class DataCheckRegistry:
"""Create central registry for all data checks in AlekSIS."""
data_checks = []
data_checks: set = set()
@classproperty
def data_checks_by_name(cls):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment