diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index f20b8c24d..b6f63d195 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -37,6 +37,7 @@ VAPID_PUBLIC_KEY = environ.get("VAPID_PUBLIC_KEY").strip() VAPID_PRIVATE_KEY = environ.get("VAPID_PRIVATE_KEY").strip() CF_KEY = environ.get("CF_KEY").strip() CF_ZONE = environ.get("CF_ZONE").strip() +II_KEY = environ.get("II_KEY", "").strip() blackjack = environ.get("BLACKJACK", "").strip() PROGSTACK_MUL = float(environ.get("PROGSTACK_MUL", 2.0)) ENCOURAGED = environ.get("ENCOURAGED", "").strip().split() diff --git a/files/routes/login.py b/files/routes/login.py index 18c13113e..d7f9868ee 100644 --- a/files/routes/login.py +++ b/files/routes/login.py @@ -239,6 +239,13 @@ def sign_up_post(v): email=email, ), 400 + + if II_KEY: + data = requests.get(f'https://ipinfo.io/{get_IP()}?token={II_KEY}', headers=HEADERS, timeout=5).json() + print(data['region'], flush=True) + if data['region'] == 'Tennessee': + return signup_error("There was a problem. Please try again!") + if username.title() in GIRL_NAMES_TOTAL: return signup_error("This name is reserved for a site award.")