mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-03 00:31:25 -08:00
Backfill: ignore community slug that Lemmy adds as a hashtag
This commit is contained in:
parent
54254b11c2
commit
a4d981d431
1 changed files with 5 additions and 3 deletions
|
@ -925,9 +925,11 @@ def post_json_to_model(activity_log, post_json, user, community) -> Post:
|
|||
if 'tag' in post_json:
|
||||
for json_tag in post_json['tag']:
|
||||
if json_tag['type'] == 'Hashtag':
|
||||
hashtag = find_hashtag_or_create(json_tag['name'])
|
||||
if hashtag:
|
||||
post.tags.append(hashtag)
|
||||
# Lemmy adds the community slug as a hashtag on every post in the community, which we want to ignore
|
||||
if json_tag['name'][1:].lower() != community.name.lower():
|
||||
hashtag = find_hashtag_or_create(json_tag['name'])
|
||||
if hashtag:
|
||||
post.tags.append(hashtag)
|
||||
|
||||
if post is not None:
|
||||
if 'image' in post_json and post.image is None:
|
||||
|
|
Loading…
Add table
Reference in a new issue