Fixed 500 on some urls

This commit is contained in:
Agate 2020-08-23 12:24:35 +02:00
parent a9589fe8ac
commit 884e64d4cf
1 changed files with 1 additions and 6 deletions

View File

@ -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(