From f1d79f1e908c0d07190a5162860b265c26b1a953 Mon Sep 17 00:00:00 2001 From: Aaron Kimbre Date: Sun, 3 Apr 2022 11:35:53 -0500 Subject: [PATCH] cleanup and fixes --- app/__init__.py | 8 -------- app/luclient.py | 5 ++++- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index c3a1fa5..e590f7e 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -82,14 +82,6 @@ def create_app(): if cdclient is not None: cdclient.close() - # @app.errorhandler(Exception) - # def handle_exception(e): - # app.logger.error(e) - # # pass through HTTP errors - # if isinstance(e, HTTPException): - # return e - # # now you're handling non-HTTP exceptions only - # return render_template("status_codes/500.html.j2", exception=e), 500 # add the commands to flask cli app.cli.add_command(init_db) diff --git a/app/luclient.py b/app/luclient.py index 1150e74..5fcea72 100644 --- a/app/luclient.py +++ b/app/luclient.py @@ -76,7 +76,10 @@ def get_icon_lot(id): one=True )[0] - filename = filename.replace("..\\", "").replace("\\", "/") + if filename: + filename = filename.replace("..\\", "").replace("\\", "/") + else: + return redirect(url_for('luclient.unknown')) cache = f'app/cache/{filename.split(".")[0]}.png'