From 44bff188c27031dc850b0cb6f8c2ed6fbccd042f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 15 Jul 2024 21:08:25 +0100 Subject: [PATCH] Less indentation --- posts.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/posts.py b/posts.py index 1cc7f1a75..92dfd8f96 100644 --- a/posts.py +++ b/posts.py @@ -1545,21 +1545,22 @@ def _consolidate_actors_list(actors_list: []) -> None: if '/@/' not in cc_actor: if cc_actor not in possible_duplicate_actors: possible_duplicate_actors.append(cc_actor) - if possible_duplicate_actors: - u_paths = get_user_paths() - remove_actors = [] - for cc_actor in possible_duplicate_actors: - for usr_path in u_paths: - if '/@/' not in cc_actor: - cc_actor_full = cc_actor.replace('/@', usr_path) - else: - cc_actor_full = cc_actor - if cc_actor_full in actors_list: - if cc_actor not in remove_actors: - remove_actors.append(cc_actor) - break - for cc_actor in remove_actors: - actors_list.remove(cc_actor) + if not possible_duplicate_actors: + return + u_paths = get_user_paths() + remove_actors = [] + for cc_actor in possible_duplicate_actors: + for usr_path in u_paths: + if '/@/' not in cc_actor: + cc_actor_full = cc_actor.replace('/@', usr_path) + else: + cc_actor_full = cc_actor + if cc_actor_full in actors_list: + if cc_actor not in remove_actors: + remove_actors.append(cc_actor) + break + for cc_actor in remove_actors: + actors_list.remove(cc_actor) def _create_post_mentions(cc_url: str, new_post: {},