Mark Hashtag.name field as deduplication field

This ensures that when an existing hashtag comes in through ActivityPub federation,
it correctly finds the local one, instead of creating duplicate hashtags.
This commit is contained in:
Christof Dorner 2023-02-17 19:23:04 +01:00
parent e8a306437f
commit 0fd49d2aea

View file

@ -9,7 +9,11 @@ class Hashtag(ActivitypubMixin, BookWyrmModel):
"a hashtag which can be used in statuses"
name = CICharField(
max_length=256, blank=False, null=False, activitypub_field="name"
max_length=256,
blank=False,
null=False,
activitypub_field="name",
deduplication_field=True,
)
name_field = "name"