set_initial_no_auth_action_count should restore request_count.
This commit is contained in:
parent
cc843bb8c5
commit
140f4110ac
@ -129,12 +129,14 @@ class ActionAuthenticatorMixin(object):
|
|||||||
def decorator(function):
|
def decorator(function):
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
original_initial_no_auth_action_count = settings.INITIAL_NO_AUTH_ACTION_COUNT
|
original_initial_no_auth_action_count = settings.INITIAL_NO_AUTH_ACTION_COUNT
|
||||||
|
original_request_count = ActionAuthenticatorMixin.request_count
|
||||||
settings.INITIAL_NO_AUTH_ACTION_COUNT = initial_no_auth_action_count
|
settings.INITIAL_NO_AUTH_ACTION_COUNT = initial_no_auth_action_count
|
||||||
ActionAuthenticatorMixin.request_count = 0
|
ActionAuthenticatorMixin.request_count = 0
|
||||||
try:
|
try:
|
||||||
result = function(*args, **kwargs)
|
result = function(*args, **kwargs)
|
||||||
finally:
|
finally:
|
||||||
settings.INITIAL_NO_AUTH_ACTION_COUNT = original_initial_no_auth_action_count
|
settings.INITIAL_NO_AUTH_ACTION_COUNT = original_initial_no_auth_action_count
|
||||||
|
ActionAuthenticatorMixin.request_count = original_request_count
|
||||||
return result
|
return result
|
||||||
|
|
||||||
functools.update_wrapper(wrapper, function)
|
functools.update_wrapper(wrapper, function)
|
||||||
|
Loading…
Reference in New Issue
Block a user