Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Defer ThrottledApplication reference (#682)
Browse files Browse the repository at this point in the history
  • Loading branch information
AetherUnbound authored May 5, 2022
1 parent f90f1e2 commit b74c751
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/catalog/api/utils/oauth2_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from oauth2_provider.models import AccessToken

from catalog.api.models import ThrottledApplication
from catalog.api import models


log = logging.getLogger(__name__)
Expand All @@ -25,11 +25,11 @@ def get_token_info(token: str):
return None, None, None
if token.expires >= dt.datetime.now(token.expires.tzinfo):
try:
application = ThrottledApplication.objects.get(accesstoken=token)
application = models.ThrottledApplication.objects.get(accesstoken=token)
client_id = str(application.client_id)
rate_limit_model = application.rate_limit_model
verified = application.verified
except ThrottledApplication.DoesNotExist:
except models.ThrottledApplication.DoesNotExist:
log.warning("Failed to find application associated with access token.")
client_id = None
rate_limit_model = None
Expand Down

0 comments on commit b74c751

Please sign in to comment.