Skip to content

Commit

Permalink
I have no idea what I'm doing at this point
Browse files Browse the repository at this point in the history
  • Loading branch information
defaultnamehere committed Jun 26, 2017
1 parent f62e0ed commit 57d39c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion database.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)):
Expand Down
6 changes: 2 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 57d39c0

Please sign in to comment.