From 112593fb5f1fdee5bf695b9cd32ec86c5511f625 Mon Sep 17 00:00:00 2001 From: ChillarAnand Date: Fri, 1 Apr 2022 12:05:04 +0530 Subject: [PATCH] fix: Use github.com when github api rate is crossed --- frappe/installer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frappe/installer.py b/frappe/installer.py index e28a942f01..ffb595e9ad 100644 --- a/frappe/installer.py +++ b/frappe/installer.py @@ -142,8 +142,10 @@ def find_org(org_repo: str) -> Tuple[str, str]: import requests for org in ["frappe", "erpnext"]: - res = requests.head(f"https://api.github.com/repos/{org}/{org_repo}") - if res.ok: + response = requests.head(f"https://api.github.com/repos/{org}/{org_repo}") + if response.status_code == 400: + response = requests.head(f"https://github.com/{org}/{org_repo}") + if response.ok: return org, org_repo raise InvalidRemoteException