From 81d88f23845bc75c970e95db3f0b6da9924c09b5 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 15 Jul 2024 20:59:58 +0100 Subject: [PATCH] Less indentation --- posts.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/posts.py b/posts.py index 3c521337b..f86d9d1d4 100644 --- a/posts.py +++ b/posts.py @@ -872,19 +872,22 @@ def get_post_domains(session, outbox_url: str, max_posts: int, debug: bool, if post_domain not in post_domains: post_domains.append(post_domain) - if item['object'].get('tag'): - for tag_item in item['object']['tag']: - if not tag_item.get('type'): - continue - tag_type = tag_item['type'].lower() - if tag_type == 'mention': - if tag_item.get('href'): - tag_url = remove_html(tag_item['href']) - post_domain, _ = \ - get_domain_from_actor(tag_url) - if post_domain: - if post_domain not in post_domains: - post_domains.append(post_domain) + if not item['object'].get('tag'): + continue + for tag_item in item['object']['tag']: + if not tag_item.get('type'): + continue + tag_type = tag_item['type'].lower() + if tag_type != 'mention': + continue + if not tag_item.get('href'): + continue + tag_url = remove_html(tag_item['href']) + post_domain, _ = get_domain_from_actor(tag_url) + if not post_domain: + continue + if post_domain not in post_domains: + post_domains.append(post_domain) return post_domains