mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 08:29:17 +02:00
See #542: fixed issue with empty actor during upgrade script
This commit is contained in:
parent
e1628a33d2
commit
02006270cd
3 changed files with 14 additions and 2 deletions
|
@ -71,7 +71,15 @@ def update_uploads(libraries_by_user, stdout):
|
|||
|
||||
def update_orphan_uploads(open_api, stdout):
|
||||
privacy_level = "everyone" if open_api else "instance"
|
||||
first_superuser = User.objects.filter(is_superuser=True).order_by("pk").first()
|
||||
first_superuser = (
|
||||
User.objects.filter(is_superuser=True)
|
||||
.exclude(actor=None)
|
||||
.order_by("pk")
|
||||
.first()
|
||||
)
|
||||
if not first_superuser:
|
||||
stdout.write("* No superuser found, skipping update orphan uploads")
|
||||
return
|
||||
library, _ = models.Library.objects.get_or_create(
|
||||
name="default",
|
||||
actor=first_superuser.actor,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue