Skip to content

Commit

Permalink
Merge pull request #2524 from Kaptian/patch-1
Browse files Browse the repository at this point in the history
Allow non-standard User models with Throttling
  • Loading branch information
xordoquy committed Feb 5, 2015
2 parents 3b00824 + fffde8a commit 24372ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rest_framework/throttling.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class UserRateThrottle(SimpleRateThrottle):

def get_cache_key(self, request, view):
if request.user.is_authenticated():
ident = request.user.id
ident = request.user.pk
else:
ident = self.get_ident(request)

Expand Down Expand Up @@ -239,7 +239,7 @@ def get_cache_key(self, request, view):
with the '.throttle_scope` property of the view.
"""
if request.user.is_authenticated():
ident = request.user.id
ident = request.user.pk
else:
ident = self.get_ident(request)

Expand Down

0 comments on commit 24372ec

Please sign in to comment.