Store user that added link

This commit is contained in:
Mouse Reeve
2022-01-10 13:27:01 -08:00
parent 6c78a7b6ef
commit 34f375c53c
4 changed files with 9 additions and 4 deletions

View File

@ -15,6 +15,12 @@ class Link(ActivitypubMixin, BookWyrmModel):
"""a link to a website"""
url = fields.URLField(max_length=255, activitypub_field="href")
added_by = fields.ForeignKey(
"User",
on_delete=models.SET_NULL,
null=True,
activitypub_field="attributedTo"
)
domain = models.ForeignKey(
"LinkDomain",
on_delete=models.CASCADE,
@ -22,9 +28,6 @@ class Link(ActivitypubMixin, BookWyrmModel):
blank=True,
related_name="links",
)
added_by = fields.ForeignKey(
"User", on_delete=models.SET_NULL, null=True, activitypub_field="attributedTo"
)
activity_serializer = activitypub.Link
reverse_unfurl = True