From 3a751273012c9f77bf0614b7c18340e2f17edd3a Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 3 Dec 2020 13:00:04 -0800 Subject: [PATCH] Removes half-baked field serializers --- bookwyrm/models/fields.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/bookwyrm/models/fields.py b/bookwyrm/models/fields.py index 960f3605..2b0b3b47 100644 --- a/bookwyrm/models/fields.py +++ b/bookwyrm/models/fields.py @@ -102,16 +102,6 @@ class ForeignKey(ActivitypubFieldMixin, models.ForeignKey): return None return value.remote_id - def field_from_activity(self, value): - if isinstance(value, dict) and value.get('id'): - # if the AP field is a serialized object (as in Add) - remote_id = value['id'] - else: - # if the field is just a remote_id (as in every other case) - remote_id = value - - return resolve_remote_id(remote_id) - class OneToOneField(ActivitypubFieldMixin, models.OneToOneField): ''' activitypub-aware foreign key field ''' @@ -132,12 +122,6 @@ class ManyToManyField(ActivitypubFieldMixin, models.ManyToManyField): return '%s/followers' % value.instance.remote_id return [i.remote_id for i in value.all()] - def field_from_activity(self, valueactivity_data): - if self.link_only: - return None - values = super().field_from_activity(values) - return values# TODO - class TagField(ManyToManyField): ''' special case of many to many that uses Tags '''