providers/oauth2: fix accessing undefined variable

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-08-07 21:35:17 +02:00
parent ff579fd387
commit f6ab241219

View file

@ -186,7 +186,7 @@ class TokenView(View):
try: try:
self.provider = OAuth2Provider.objects.get(client_id=client_id) self.provider = OAuth2Provider.objects.get(client_id=client_id)
except OAuth2Provider.DoesNotExist: except OAuth2Provider.DoesNotExist:
LOGGER.warning("OAuth2Provider does not exist", client_id=self.client_id) LOGGER.warning("OAuth2Provider does not exist", client_id=client_id)
raise TokenError("invalid_client") raise TokenError("invalid_client")
if not self.provider: if not self.provider: