Skip to content

Commit

Permalink
Bugfix: ratelimit set in bootstrap (#162)
Browse files Browse the repository at this point in the history
- If a ratelimit was not specified in the request and the client existed, its current ratelimit gets overridden by the default ratelimit
- If a ratelimit was specified in the request and the client existed, its ratelimit is changed without verifying it has the required quota to do so
  • Loading branch information
marblestation committed Jan 11, 2019
1 parent 6ea3799 commit e396c69
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion adsws/accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,9 @@ def get(self):
client._redirect_uris = redirect_uri
if client_name:
client.client_name = client_name
if client.ratelimit != ratelimit:
if kwargs.get('ratelimit') is not None and client.ratelimit != ratelimit:
# If the client ratelimit was included in the request and it is different from the current ratelimit
self._check_ratelimit(ratelimit)
client.ratelimit = ratelimit

client.last_activity = datetime.datetime.now()
Expand Down

0 comments on commit e396c69

Please sign in to comment.