Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions authentik/events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ def log_deprecation(
action=EventAction.CONFIGURATION_WARNING,
context__deprecation=identifier,
)
cause = str(cause)
if cause:
query &= Q(context__cause=cause)
if Event.objects.filter(query).exists():
Expand Down
11 changes: 11 additions & 0 deletions authentik/events/tests/test_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,14 @@ def test_password_set_signal_on_set_password_from_hash(self):

new_count = Event.objects.filter(action=EventAction.PASSWORD_SET, user__pk=user.pk).count()
self.assertEqual(new_count, old_count + 1)

def test_log_deprecation(self):
"""Test Event.log_deprecation"""
Event.log_deprecation(self.__module__, "Test deprecation")
Event.log_deprecation(self.__module__, "Test deprecation")
Event.log_deprecation(self.__module__, "Test deprecation")
Event.log_deprecation(self.__module__, "Test deprecation", cause=create_test_user())
logs = Event.objects.filter(
action=EventAction.CONFIGURATION_WARNING, context__deprecation=self.__module__
)
self.assertEqual(logs.count(), 2)
2 changes: 1 addition & 1 deletion authentik/providers/saml/views/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def get(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
"Redirect binding for Service Provider binding is deprecated "
"and will be removed in a future version. Use Post binding instead."
),
cause=provider,
cause=provider.name,
)
url_args = {
REQUEST_KEY_SAML_RESPONSE: deflate_and_base64_encode(response),
Expand Down
Loading