Library can now automatically accept follows

merge-requests/154/head
Eliot Berriot 2018-04-07 17:24:33 +02:00
rodzic 4320fc77b2
commit 514e48d3fe
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: DD6965E2476E5C27
1 zmienionych plików z 14 dodań i 0 usunięć

Wyświetl plik

@ -203,6 +203,20 @@ class LibraryActor(SystemActor):
def manually_approves_followers(self):
return settings.FEDERATION_MUSIC_NEEDS_APPROVAL
def handle_follow(self, ac, sender):
system_actor = self.get_actor_instance()
if self.manually_approves_followers:
fr, created = models.FollowRequest.objects.get_or_create(
actor=sender,
target=system_actor,
approved=None,
)
return fr
return activity.accept_follow(
system_actor, ac, sender
)
@transaction.atomic
def handle_create(self, ac, sender):
try: