Unverified Commit 5d3853d3 authored by petitminion's avatar petitminion Committed by Georg Krause
Browse files

Update api/funkwhale_api/federation/actors.py, api/funkwhale_api/federation/tasks.py

parent 8148c8dd
Pipeline #20734 failed with stage
in 8 seconds
import datetime
import logging
from requests import HTTPError
from django.conf import settings
from django.utils import timezone
......@@ -22,8 +21,6 @@ def get_actor_data(actor_url):
response.raise_for_status()
try:
return response.json()
except HTTPError:
raise HTTPError
except Exception:
raise ValueError("Invalid actor payload: {}".format(response.text))
......
......@@ -18,7 +18,6 @@ from funkwhale_api.common import preferences
from funkwhale_api.common import models as common_models
from funkwhale_api.common import session
from funkwhale_api.common import utils as common_utils
from funkwhale_api.federation import models as federation_models
from funkwhale_api.federation import actors as actors_utils
from funkwhale_api.moderation import mrf
from funkwhale_api.music import models as music_models
......@@ -372,7 +371,6 @@ def fetch(fetch_obj):
fetch_obj.url = alternate_url
fetch_obj.save(update_fields=["url"])
return fetch(fetch_id=fetch_obj.pk)
logger.info("json is" + str(response.text))
return error("invalid_json")
payload, updated = mrf.inbox.apply(payload)
......@@ -633,7 +631,7 @@ def fetch_collection(url, max_pages, channel, is_page=False):
@celery.app.task(name="federation.refresh_actor_data")
def refresh_actor_data():
actors = federation_models.Actor.objects.all().prefetch_related()
actors = models.Actor.objects.all().prefetch_related()
for actor in actors:
try:
data = actors_utils.get_actor_data(actor.fid)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment