mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-17 04:58:16 -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,6 +31,8 @@ def _record_object_deleted(request, instance, **kwargs):
|
|||||||
|
|
||||||
# Force resolution of request.user in case it's still a SimpleLazyObject. This seems to happen
|
# 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.
|
# occasionally during tests, but haven't been able to determine why.
|
||||||
|
# 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
|
assert request.user.is_authenticated
|
||||||
|
|
||||||
# Record that the object was deleted
|
# Record that the object was deleted
|
||||||
|
Loading…
Reference in New Issue
Block a user