From 187108d495a197cc3258d24a00eff9185ac8dc6c Mon Sep 17 00:00:00 2001 From: Petitminion Date: Wed, 22 Jan 2025 13:39:18 +0100 Subject: [PATCH] fix Cannot fetch local actor webfinger Part-of: --- api/funkwhale_api/federation/authentication.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/api/funkwhale_api/federation/authentication.py b/api/funkwhale_api/federation/authentication.py index 171b66106..1ecee00e9 100644 --- a/api/funkwhale_api/federation/authentication.py +++ b/api/funkwhale_api/federation/authentication.py @@ -81,11 +81,12 @@ class SignatureAuthentication(authentication.BaseAuthentication): fetch_delay = 24 * 3600 now = timezone.now() last_fetch = actor.domain.nodeinfo_fetch_date - if not last_fetch or ( - last_fetch < (now - datetime.timedelta(seconds=fetch_delay)) - ): - tasks.update_domain_nodeinfo(domain_name=actor.domain.name) - actor.domain.refresh_from_db() + if not actor.domain.is_local: + if not last_fetch or ( + last_fetch < (now - datetime.timedelta(seconds=fetch_delay)) + ): + tasks.update_domain_nodeinfo(domain_name=actor.domain.name) + actor.domain.refresh_from_db() return actor def authenticate(self, request):