diff --git a/passbook/audit/models.py b/passbook/audit/models.py index 6febb1698..d9693d4bc 100644 --- a/passbook/audit/models.py +++ b/passbook/audit/models.py @@ -60,7 +60,8 @@ class AuditEntry(UUIDModel): # User 255.255.255.255 as fallback if IP cannot be determined request_ip=client_ip or '255.255.255.255', context=kwargs) - LOGGER.debug("Logged %s from %s (%s)", action, user, client_ip) + LOGGER.debug("Created Audit entry", action=action, + user=user, from_ip=client_ip, context=kwargs) return entry def save(self, *args, **kwargs): diff --git a/passbook/factors/password/factor.py b/passbook/factors/password/factor.py index 0d5325be1..ed2a2244a 100644 --- a/passbook/factors/password/factor.py +++ b/passbook/factors/password/factor.py @@ -30,7 +30,7 @@ def authenticate(request, backends, **credentials) -> Optional[User]: signature = Signature.from_callable(backend.authenticate) signature.bind(request, **credentials) except TypeError: - LOGGER.debug("Backend doesn't accept our arguments", backend=backend) + LOGGER.warning("Backend doesn't accept our arguments", backend=backend) # This backend doesn't accept these credentials as arguments. Try the next one. continue LOGGER.debug('Attempting authentication...', backend=backend) diff --git a/passbook/factors/view.py b/passbook/factors/view.py index d53d38502..062bab75e 100644 --- a/passbook/factors/view.py +++ b/passbook/factors/view.py @@ -134,7 +134,7 @@ class AuthenticationView(UserPassesTestMixin, View): LOGGER.debug("Rendering Factor", next_factor=next_factor) return _redirect_with_qs('passbook_core:auth-process', self.request.GET) # User passed all factors - LOGGER.debug("User passed all factors, logging in") + LOGGER.debug("User passed all factors, logging in", user=self.pending_user) return self._user_passed() def user_invalid(self): diff --git a/passbook/root/settings.py b/passbook/root/settings.py index 0c7041798..f829520aa 100644 --- a/passbook/root/settings.py +++ b/passbook/root/settings.py @@ -307,7 +307,12 @@ if any('test' in arg for arg in sys.argv): CELERY_TASK_ALWAYS_EAGER = True -_DISALLOWED_ITEMS = ['INSTALLED_APPS', 'MIDDLEWARE', 'AUTHENTICATION_BACKENDS'] +_DISALLOWED_ITEMS = [ + 'INSTALLED_APPS', + 'MIDDLEWARE', + 'AUTHENTICATION_BACKENDS', + 'CELERY_BEAT_SCHEDULE' +] # Load subapps's INSTALLED_APPS for _app in INSTALLED_APPS: if _app.startswith('passbook'): @@ -318,6 +323,7 @@ for _app in INSTALLED_APPS: INSTALLED_APPS.extend(getattr(app_settings, 'INSTALLED_APPS', [])) MIDDLEWARE.extend(getattr(app_settings, 'MIDDLEWARE', [])) AUTHENTICATION_BACKENDS.extend(getattr(app_settings, 'AUTHENTICATION_BACKENDS', [])) + CELERY_BEAT_SCHEDULE.update(getattr(app_settings, 'CELERY_BEAT_SCHEDULE', {})) for _attr in dir(app_settings): if not _attr.startswith('__') and _attr not in _DISALLOWED_ITEMS: globals()[_attr] = getattr(app_settings, _attr)