mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 09:49:23 +02:00
Blacked the code
This commit is contained in:
parent
b6fc0051fa
commit
62ca3bd736
279 changed files with 8861 additions and 9527 deletions
|
@ -8,22 +8,19 @@ from funkwhale_api.federation import models
|
|||
|
||||
|
||||
class Listen(BasePermission):
|
||||
|
||||
def has_permission(self, request, view):
|
||||
if not preferences.get('common__api_authentication_required'):
|
||||
if not preferences.get("common__api_authentication_required"):
|
||||
return True
|
||||
|
||||
user = getattr(request, 'user', None)
|
||||
user = getattr(request, "user", None)
|
||||
if user and user.is_authenticated:
|
||||
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()
|
||||
library = actors.SYSTEM_ACTORS["library"].get_actor_instance()
|
||||
return models.Follow.objects.filter(
|
||||
target=library,
|
||||
actor=actor,
|
||||
approved=True
|
||||
target=library, actor=actor, approved=True
|
||||
).exists()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue