mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 23:08:25 +02:00
We now persist system accounts to database
This commit is contained in:
parent
fba9a5c97e
commit
48df30dbd8
2 changed files with 19 additions and 8 deletions
|
@ -49,15 +49,17 @@ class SystemActor(object):
|
|||
additional_attributes = {}
|
||||
|
||||
def get_actor_instance(self):
|
||||
a = models.Actor(
|
||||
**self.get_instance_argument(
|
||||
self.id,
|
||||
name=self.name,
|
||||
summary=self.summary,
|
||||
**self.additional_attributes
|
||||
)
|
||||
args = self.get_instance_argument(
|
||||
self.id,
|
||||
name=self.name,
|
||||
summary=self.summary,
|
||||
**self.additional_attributes
|
||||
)
|
||||
url = args.pop('url')
|
||||
a, created = models.Actor.objects.get_or_create(
|
||||
url=url,
|
||||
defaults=args,
|
||||
)
|
||||
a.pk = self.id
|
||||
return a
|
||||
|
||||
def get_instance_argument(self, id, name, summary, **kwargs):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue