From bbb89f5763accbabe5c590060d76fca93032d6b1 Mon Sep 17 00:00:00 2001 From: Dominik George <dominik.george@teckids.org> Date: Thu, 6 Feb 2020 14:46:50 +0100 Subject: [PATCH] Add missing kwargs argument and reformat --- aleksis/core/apps.py | 5 +++-- aleksis/core/util/apps.py | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/aleksis/core/apps.py b/aleksis/core/apps.py index 906969c11..b373367ef 100644 --- a/aleksis/core/apps.py +++ b/aleksis/core/apps.py @@ -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": ""} ) diff --git a/aleksis/core/util/apps.py b/aleksis/core/util/apps.py index 9a294f8ec..2e4ab1d0a 100644 --- a/aleksis/core/util/apps.py +++ b/aleksis/core/util/apps.py @@ -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 -- GitLab