From cb0cb3a52cea364d45f29313ff83f952eb57debf Mon Sep 17 00:00:00 2001 From: Vanessasaurus <814322+vsoch@users.noreply.github.com> Date: Sat, 21 Oct 2023 21:12:16 -0600 Subject: [PATCH] Don't add empty data when getting org GitHub repos --- rse/main/parsers/github.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rse/main/parsers/github.py b/rse/main/parsers/github.py index bf501eb..cad9088 100644 --- a/rse/main/parsers/github.py +++ b/rse/main/parsers/github.py @@ -89,7 +89,9 @@ def get_org_repos(self, org, paginate=True, delay=None): if data and paginate: url = original_url + "&page=%s" % page - repos = repos + data + # If a request goes wrong and we don't get data, skip + if data: + repos = repos + data page += 1 # Sleep for a random amount of time to give a rest! sleep(delay or random.choice(range(1, 10)) * 0.1)