From 12a51bbb5461a6916f47c9fca80037889cf05c93 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Thu, 22 Feb 2024 16:43:45 +1100 Subject: [PATCH] fix: use global variable to stop issues --- server.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server.py b/server.py index 0498b72..8858a28 100644 --- a/server.py +++ b/server.py @@ -88,6 +88,7 @@ def wallet(path): @app.route('/') def index(): global address + global handshake_scripts git=requests.get('https://git.woodburn.au/api/v1/users/nathanwoodburn/activities/feeds?only-performed-by=true&limit=1&token=' + os.getenv('git_token')) git = git.json() git = git[0] @@ -104,10 +105,6 @@ def index(): custom += "" else: custom += "" - - - - # Special names if repo_name == "nathanwoodburn.github.io": repo_name = "Nathan.Woodburn/" @@ -133,6 +130,7 @@ def index(): @app.route('/now') def now(): + global handshake_scripts # If localhost, don't load handshake if request.host == "localhost:5000" or request.host == "127.0.0.1:5000" or os.getenv('dev') == "true" or request.host == "test.nathan.woodburn.au": @@ -148,6 +146,7 @@ def now(): @app.route('/') def catch_all(path): + global handshake_scripts # If localhost, don't load handshake if request.host == "localhost:5000" or request.host == "127.0.0.1:5000" or os.getenv('dev') == "true" or request.host == "test.nathan.woodburn.au": handshake_scripts = ""