mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 23:18:26 +02:00
See #186: moved federation settings to preferences
This commit is contained in:
parent
7222f7b710
commit
6100b106c0
10 changed files with 103 additions and 59 deletions
|
@ -12,6 +12,7 @@ from rest_framework.exceptions import PermissionDenied
|
|||
|
||||
from dynamic_preferences.registries import global_preferences_registry
|
||||
|
||||
from funkwhale_api.common import preferences
|
||||
from funkwhale_api.common import session
|
||||
from funkwhale_api.common import utils as funkwhale_utils
|
||||
from funkwhale_api.music import models as music_models
|
||||
|
@ -55,7 +56,7 @@ def get_actor(actor_url):
|
|||
except models.Actor.DoesNotExist:
|
||||
actor = None
|
||||
fetch_delta = datetime.timedelta(
|
||||
minutes=settings.FEDERATION_ACTOR_FETCH_DELAY)
|
||||
minutes=preferences.get('federation__actor_fetch_delay'))
|
||||
if actor and actor.last_fetch_date > timezone.now() - fetch_delta:
|
||||
# cache is hot, we can return as is
|
||||
return actor
|
||||
|
@ -225,7 +226,7 @@ class LibraryActor(SystemActor):
|
|||
|
||||
@property
|
||||
def manually_approves_followers(self):
|
||||
return settings.FEDERATION_MUSIC_NEEDS_APPROVAL
|
||||
return preferences.get('federation__music_needs_approval')
|
||||
|
||||
@transaction.atomic
|
||||
def handle_create(self, ac, sender):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue