Blacked the code

This commit is contained in:
Eliot Berriot 2018-06-09 15:36:16 +02:00
parent b6fc0051fa
commit 62ca3bd736
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
279 changed files with 8861 additions and 9527 deletions

View file

@ -11,11 +11,13 @@ class HasUserPermission(BasePermission):
permission_classes = [HasUserPermission]
required_permissions = ['federation']
"""
def has_permission(self, request, view):
if not hasattr(request, 'user') or not request.user:
if not hasattr(request, "user") or not request.user:
return False
if request.user.is_anonymous:
return False
operator = getattr(view, 'permission_operator', 'and')
operator = getattr(view, "permission_operator", "and")
return request.user.has_permissions(
*view.required_permissions, operator=operator)
*view.required_permissions, operator=operator
)