mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-16 12:38:17 -06:00
In _record_object_deleted(), don't assert on SAML2 login deletions.
Previously, the call to r.session.flush() in django-saml2-auth plugin raised this assertion, as the request session doesn't exist at this point in the flow.
This commit is contained in:
parent
04419e8eaa
commit
6c6eb6ffd0
@ -31,7 +31,9 @@ def _record_object_deleted(request, instance, **kwargs):
|
||||
|
||||
# Force resolution of request.user in case it's still a SimpleLazyObject. This seems to happen
|
||||
# occasionally during tests, but haven't been able to determine why.
|
||||
assert request.user.is_authenticated
|
||||
# Note: We exclude SAML2 login flow deletions, as the call to request.session.flush() throws this assertion
|
||||
if request.path_info != '/saml2_auth/acs/':
|
||||
assert request.user.is_authenticated
|
||||
|
||||
# Record that the object was deleted
|
||||
if hasattr(instance, 'log_change'):
|
||||
|
Loading…
Reference in New Issue
Block a user