From 0d96e75eeb8d2b4a32b3a23bfd56b87ed651bd2f Mon Sep 17 00:00:00 2001 From: Eliot Berriot <contact@eliotberriot.com> Date: Wed, 26 Sep 2018 19:23:15 +0200 Subject: [PATCH] Do not silent import errors --- api/funkwhale_api/music/tasks.py | 3 ++- .../providers/audiofile/management/commands/import_files.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/funkwhale_api/music/tasks.py b/api/funkwhale_api/music/tasks.py index f3a57a83..8d2b276e 100644 --- a/api/funkwhale_api/music/tasks.py +++ b/api/funkwhale_api/music/tasks.py @@ -236,7 +236,8 @@ def process_upload(upload): except UploadImportError as e: return fail_import(upload, e.code) except Exception: - return fail_import(upload, "unknown_error") + fail_import(upload, "unknown_error") + raise # under some situations, we want to skip the import ( # for instance if the user already owns the files) diff --git a/api/funkwhale_api/providers/audiofile/management/commands/import_files.py b/api/funkwhale_api/providers/audiofile/management/commands/import_files.py index d4917be5..af5d2cee 100644 --- a/api/funkwhale_api/providers/audiofile/management/commands/import_files.py +++ b/api/funkwhale_api/providers/audiofile/management/commands/import_files.py @@ -130,7 +130,7 @@ class Command(BaseCommand): except models.Library.DoesNotExist: raise CommandError("Invalid library id") - if not library.actor.is_local: + if not library.actor.get_user(): raise CommandError("Library {} is not a local library".format(library.uuid)) if options["recursive"]: -- GitLab