Boost and unboost federation fixes

This commit is contained in:
Mouse Reeve
2020-11-04 16:28:32 -08:00
parent 21c0a0163a
commit 152343d251
4 changed files with 35 additions and 27 deletions

View File

@ -76,6 +76,12 @@ class ActivityObject:
if not isinstance(self, model.activity_serializer):
raise TypeError('Wrong activity type for model')
# check for an existing instance
try:
return model.objects.get(remote_id=self.id)
except model.DoesNotExist:
pass
model_fields = [m.name for m in model._meta.get_fields()]
mapped_fields = {}

View File

@ -8,7 +8,7 @@ from .base_activity import ActivityObject
class Like(ActivityObject):
''' a user faving an object '''
actor: str
object: ActivityObject
object: str
type: str = 'Like'
@ -16,5 +16,5 @@ class Like(ActivityObject):
class Boost(ActivityObject):
''' boosting a status '''
actor: str
object: ActivityObject
object: str
type: str = 'Announce'