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

@ -7,15 +7,13 @@ from . import actors
class LibraryFollower(BasePermission):
def has_permission(self, request, view):
if not preferences.get('federation__music_needs_approval'):
if not preferences.get("federation__music_needs_approval"):
return True
actor = getattr(request, 'actor', None)
actor = getattr(request, "actor", None)
if actor is None:
return False
library = actors.SYSTEM_ACTORS['library'].get_actor_instance()
return library.received_follows.filter(
approved=True, actor=actor).exists()
library = actors.SYSTEM_ACTORS["library"].get_actor_instance()
return library.received_follows.filter(approved=True, actor=actor).exists()