diff --git a/lemonauth/views/tokens/list.py b/lemonauth/views/tokens/list.py index 52e0760..1912937 100644 --- a/lemonauth/views/tokens/list.py +++ b/lemonauth/views/tokens/list.py @@ -1,3 +1,4 @@ +from requests import HTTPError from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic import TemplateView from typing import Dict, Optional, Set @@ -20,10 +21,10 @@ class Client: self.id = client_id self.count = 0 self.scopes = set() - apps = mf2(self.id).to_dict(filter_by_type="h-x-app") try: + apps = mf2(self.id).to_dict(filter_by_type="h-x-app") self.app = apps[0]["properties"] - except IndexError: + except (HTTPError, IndexError): self.app = None