Fixed 500 on some urls
This commit is contained in:
parent
a9589fe8ac
commit
884e64d4cf
|
@ -51,12 +51,7 @@ class ScopePermission(permissions.BasePermission):
|
||||||
if request.method.lower() in ["options", "head"]:
|
if request.method.lower() in ["options", "head"]:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
try:
|
scope_config = getattr(view, "required_scope", "noopscope")
|
||||||
scope_config = getattr(view, "required_scope")
|
|
||||||
except AttributeError:
|
|
||||||
raise ImproperlyConfigured(
|
|
||||||
"ScopePermission requires the view to define the required_scope attribute"
|
|
||||||
)
|
|
||||||
anonymous_policy = getattr(view, "anonymous_policy", False)
|
anonymous_policy = getattr(view, "anonymous_policy", False)
|
||||||
if anonymous_policy not in [True, False, "setting"]:
|
if anonymous_policy not in [True, False, "setting"]:
|
||||||
raise ImproperlyConfigured(
|
raise ImproperlyConfigured(
|
||||||
|
|
Loading…
Reference in New Issue