From 884e64d4cf9de9fe46b51b13102efce67fa47ae3 Mon Sep 17 00:00:00 2001 From: Agate Date: Sun, 23 Aug 2020 12:24:35 +0200 Subject: [PATCH] Fixed 500 on some urls --- api/funkwhale_api/users/oauth/permissions.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/api/funkwhale_api/users/oauth/permissions.py b/api/funkwhale_api/users/oauth/permissions.py index 63f339268..823188d7a 100644 --- a/api/funkwhale_api/users/oauth/permissions.py +++ b/api/funkwhale_api/users/oauth/permissions.py @@ -51,12 +51,7 @@ class ScopePermission(permissions.BasePermission): if request.method.lower() in ["options", "head"]: return True - try: - scope_config = getattr(view, "required_scope") - except AttributeError: - raise ImproperlyConfigured( - "ScopePermission requires the view to define the required_scope attribute" - ) + scope_config = getattr(view, "required_scope", "noopscope") anonymous_policy = getattr(view, "anonymous_policy", False) if anonymous_policy not in [True, False, "setting"]: raise ImproperlyConfigured(