Skip to content
Snippets Groups Projects
Verified Commit bbb89f57 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Add missing kwargs argument and reformat

parent ac3e1831
No related branches found
No related tags found
1 merge request!154Maintain default data and implement app hooks
Pipeline #851 passed with warnings
......@@ -21,10 +21,11 @@ class CoreConfig(AppConfig):
using: str,
plan: List[Tuple],
apps: django.apps.registry.Apps,
**kwargs,
) -> None:
super().post_migrate(app_config, verbosity, interactive, using, plan, apps)
# Ensure presence of a OTP YubiKey default config
apps.get_model('otp_yubikey', 'ValidationService').objects.using(using).update_or_create(
name='default', defaults={'use_ssl': True, 'param_sl': '', 'param_timeout': ''}
apps.get_model("otp_yubikey", "ValidationService").objects.using(using).update_or_create(
name="default", defaults={"use_ssl": True, "param_sl": "", "param_timeout": ""}
)
......@@ -32,9 +32,7 @@ class AppConfig(django.apps.AppConfig):
# Register system checks of this app
try:
import_module(
".".join(self.__class__.__module__.split(".")[:-1] + ["checks"])
)
import_module(".".join(self.__class__.__module__.split(".")[:-1] + ["checks"]))
except ImportError:
# ImportErrors are non-fatal because checks are optional.
pass
......@@ -44,7 +42,7 @@ class AppConfig(django.apps.AppConfig):
key: Optional[str] = "",
old_value: Optional[Any] = None,
new_value: Optional[Any] = None,
**kwargs
**kwargs,
) -> None:
""" Called on every app instance if a Constance config chagnes, and once on startup
......@@ -60,6 +58,7 @@ class AppConfig(django.apps.AppConfig):
using: str,
plan: List[Tuple],
apps: django.apps.registry.Apps,
**kwargs,
) -> None:
""" Called on every app instance before its models are migrated
......@@ -75,6 +74,7 @@ class AppConfig(django.apps.AppConfig):
using: str,
plan: List[Tuple],
apps: django.apps.registry.Apps,
**kwargs,
) -> None:
""" Called on every app instance after its models have been migrated
......
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