mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-23 01:51:08 +00:00
Makes user to_activity serializer args consistent
This commit is contained in:
parent
72c08e8f77
commit
2174ea11ec
1 changed files with 4 additions and 4 deletions
|
@ -182,10 +182,10 @@ class User(OrderedCollectionPageMixin, AbstractUser):
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
def to_activity(self):
|
def to_activity(self, **kwargs):
|
||||||
"""override default AP serializer to add context object
|
"""override default AP serializer to add context object
|
||||||
idk if this is the best way to go about this"""
|
idk if this is the best way to go about this"""
|
||||||
activity_object = super().to_activity()
|
activity_object = super().to_activity(**kwargs)
|
||||||
activity_object["@context"] = [
|
activity_object["@context"] = [
|
||||||
"https://www.w3.org/ns/activitystreams",
|
"https://www.w3.org/ns/activitystreams",
|
||||||
"https://w3id.org/security/v1",
|
"https://w3id.org/security/v1",
|
||||||
|
@ -293,10 +293,10 @@ class KeyPair(ActivitypubMixin, BookWyrmModel):
|
||||||
self.private_key, self.public_key = create_key_pair()
|
self.private_key, self.public_key = create_key_pair()
|
||||||
return super().save(*args, **kwargs)
|
return super().save(*args, **kwargs)
|
||||||
|
|
||||||
def to_activity(self):
|
def to_activity(self, **kwargs):
|
||||||
"""override default AP serializer to add context object
|
"""override default AP serializer to add context object
|
||||||
idk if this is the best way to go about this"""
|
idk if this is the best way to go about this"""
|
||||||
activity_object = super().to_activity()
|
activity_object = super().to_activity(**kwargs)
|
||||||
del activity_object["@context"]
|
del activity_object["@context"]
|
||||||
del activity_object["type"]
|
del activity_object["type"]
|
||||||
return activity_object
|
return activity_object
|
||||||
|
|
Loading…
Reference in a new issue