From 1e03afe36eedf0e824b2a90ba876e8ff6878fa5b Mon Sep 17 00:00:00 2001 From: Alan Roberts Date: Fri, 13 Sep 2024 14:04:04 -0400 Subject: [PATCH] adding a size check on amount of communities requested --- app/admin/routes.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/admin/routes.py b/app/admin/routes.py index 59e2585e..833e5f6e 100644 --- a/app/admin/routes.py +++ b/app/admin/routes.py @@ -275,6 +275,12 @@ def admin_federation(): # get the community urls to join community_urls_to_join = [] + + # if the admin user wants more added than we have, then just add all of them + if communities_to_add > len(parsed_communities_sorted): + communities_to_add = len(parsed_communities_sorted) + + # make the list of urls for i in range(communities_to_add): community_urls_to_join.append(parsed_communities_sorted[i]['url'])