From 57d39c0cc61af85f861459c2937978bb11e95516 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 26 Jun 2017 14:06:28 +1000 Subject: [PATCH] I have no idea what I'm doing at this point --- database.py | 2 +- main.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/database.py b/database.py index 3fc97ef..9ab3bc1 100644 --- a/database.py +++ b/database.py @@ -14,7 +14,7 @@ def __init__(self): datastore_client = datastore.Client( project="verylegitlink") self.db = datastore_client - self.initial_setup() + # self.initial_setup() def initial_setup(self): if not self.get_sketchy_url(random.choice(sketchy_data.SAMPLE_LONG_URLS)): diff --git a/main.py b/main.py index db82675..1e5637f 100644 --- a/main.py +++ b/main.py @@ -11,18 +11,16 @@ import google app = Flask('heapslegit') + try: db = database.URLStoreModel() except google.cloud.exceptions.TooManyRequests: db = None - - - @app.route('/') def index(): - if not db: + if db is None: return render_template("429.html"), 429 sample_long_url = random.choice(sketchy_data.SAMPLE_LONG_URLS)