mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 11:31:08 +00:00
Adds discard check to favs
This commit is contained in:
parent
c0ccb7065c
commit
71bbea83f9
2 changed files with 6 additions and 1 deletions
|
@ -102,7 +102,7 @@ class ActivityObject:
|
|||
if allow_create and \
|
||||
hasattr(model, 'ignore_activity') and \
|
||||
model.ignore_activity(self):
|
||||
return None
|
||||
raise ActivitySerializerError()
|
||||
|
||||
# check for an existing instance
|
||||
instance = instance or model.find_existing(self.serialize())
|
||||
|
|
|
@ -17,6 +17,11 @@ class Favorite(ActivityMixin, BookWyrmModel):
|
|||
|
||||
activity_serializer = activitypub.Like
|
||||
|
||||
@classmethod
|
||||
def ignore_activity(cls, activity):
|
||||
''' don't bother with incoming favs of unknown statuses '''
|
||||
return cls.objects.filter(remote_id=activity.object).exists()
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
''' update user active time '''
|
||||
self.user.last_active_date = timezone.now()
|
||||
|
|
Loading…
Reference in a new issue