Support attribution field on boosts

This commit is contained in:
Mouse Reeve 2021-08-29 08:22:14 -07:00
parent 0569bce610
commit 8c8b1168d4

View file

@ -226,7 +226,12 @@ class PrivacyField(ActivitypubFieldMixin, models.CharField):
cc = data.cc
# we need to figure out who this is to get their followers link
user_field = "attributedTo" if hasattr(data, "attributedTo") else "owner"
for field in ["attributedTo", "owner", "actor"]:
if hasattr(data, field):
user_field = getattr(data, field)
break
if not user_field:
raise ValidationError("No user field found for privacy", data)
user = activitypub.resolve_remote_id(getattr(data, user_field), model="User")
if to == [self.public]: