We now persist system accounts to database

This commit is contained in:
Eliot Berriot 2018-04-02 22:12:28 +02:00
parent fba9a5c97e
commit 48df30dbd8
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
2 changed files with 19 additions and 8 deletions

View file

@ -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):