[backport] Fix throttling bug

remotes/origin/3.4.0rc
Jesús Espino 2017-09-11 15:44:54 +02:00
parent 2533507fc1
commit e9b9a962c6
2 changed files with 3 additions and 1 deletions

View File

@ -39,6 +39,8 @@ class GlobalThrottlingMixin:
} }
# If you derive a class from this mixin you have to put this class previously
# to the base throttling class.
class ThrottleByActionMixin: class ThrottleByActionMixin:
throttled_actions = [] throttled_actions = []

View File

@ -24,6 +24,6 @@ class UserDetailRateThrottle(throttling.GlobalThrottlingMixin, throttling.Thrott
throttled_actions = ["by_username", "retrieve"] throttled_actions = ["by_username", "retrieve"]
class UserUpdateRateThrottle(throttling.UserRateThrottle, throttling.ThrottleByActionMixin): class UserUpdateRateThrottle(throttling.ThrottleByActionMixin, throttling.UserRateThrottle):
scope = "user-update" scope = "user-update"
throttled_actions = ["update", "partial_update"] throttled_actions = ["update", "partial_update"]