From 910ba0662075a791321d416dbfc2a1348370aec8 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Wed, 22 May 2024 13:10:29 +1200 Subject: [PATCH] avoid attributeerror --- app/activitypub/util.py | 2 +- app/cli.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/activitypub/util.py b/app/activitypub/util.py index 6da2a58a..bf1d191c 100644 --- a/app/activitypub/util.py +++ b/app/activitypub/util.py @@ -1559,7 +1559,7 @@ def create_post(activity_log: ActivityPubLog, community: Community, request_json if 'tag' in request_json['object'] and isinstance(request_json['object']['tag'], list): for json_tag in request_json['object']['tag']: if json_tag and json_tag['type'] == 'Hashtag': - if json_tag['name'][1:].lower() != post.community.name.lower(): # 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(): # Lemmy adds the community slug as a hashtag on every post in the community, which we want to ignore hashtag = find_hashtag_or_create(json_tag['name']) if hashtag: post.tags.append(hashtag) diff --git a/app/cli.py b/app/cli.py index 19f782ae..4d2cca7d 100644 --- a/app/cli.py +++ b/app/cli.py @@ -220,7 +220,6 @@ def register(app): # retrieve list of Admins from /api/v3/site, update InstanceRole if not instance.dormant and (instance.software == 'lemmy' or instance.software == 'piefed'): - try: response = get_request(f'https://{instance.domain}/api/v3/site') except: