forked from mirrors/bookwyrm
Support attribution field on boosts
This commit is contained in:
parent
0569bce610
commit
8c8b1168d4
1 changed files with 6 additions and 1 deletions
|
@ -226,7 +226,12 @@ class PrivacyField(ActivitypubFieldMixin, models.CharField):
|
||||||
cc = data.cc
|
cc = data.cc
|
||||||
|
|
||||||
# we need to figure out who this is to get their followers link
|
# 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")
|
user = activitypub.resolve_remote_id(getattr(data, user_field), model="User")
|
||||||
|
|
||||||
if to == [self.public]:
|
if to == [self.public]:
|
||||||
|
|
Loading…
Reference in a new issue