pop off old website_dir before setting one

This commit is contained in:
Eric Lay 2024-03-27 20:12:22 -05:00
parent a021840b59
commit 381d8c28ef
1 changed files with 2 additions and 1 deletions

3
app.py
View File

@ -16,6 +16,7 @@ WEBSITE_DIRS = [name for name in os.listdir(ROOT_DIR) if not name.startswith('.'
# Site choosing logic
website_dir = None
def current_website_dir():
session.pop('website_dir', None)
if session['requests'] % 5 == 0:
session['website_dir'] = str(ROOT_DIR+"/Marvel")
elif session['requests'] % 6 == 0:
@ -46,4 +47,4 @@ def index():
return send_from_directory(session['website_dir'], 'index.html')
if __name__ == "__main__":
app.run(debug=True)
app.run()