diff --git a/app/__init__.py b/app/__init__.py index f17edc9..de27c52 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -82,6 +82,11 @@ def create_app(): if cdclient is not None: cdclient.close() + @app.template_filter() + def numberFormat(value): + return format(int(value), ',d') + + # add the commands to flask cli app.cli.add_command(init_db) app.cli.add_command(init_accounts) @@ -270,6 +275,22 @@ def register_settings(app): app.config['ENABLE_CHAR_XML_UPLOAD'] ) + if "CLIENT_LOCATION" in app.config: + app.config['CLIENT_LOCATION'] = os.getenv( + 'CLIENT_LOCATION', + app.config['CLIENT_LOCATION'] + ) + else: + app.config['CLIENT_LOCATION'] = 'app/luclient/' + + if "CD_SQLITE_LOCATION" in app.config: + app.config['CD_SQLITE_LOCATION'] = os.getenv( + 'CD_SQLITE_LOCATION', + app.config['CD_SQLITE_LOCATION'] + ) + else: + app.config['CD_SQLITE_LOCATION'] = 'app/luclient/res/' + def gm_level(gm_level): """Decorator for handling permissions based on the user's GM Level diff --git a/app/luclient.py b/app/luclient.py index 2a70111..3bbeaa7 100644 --- a/app/luclient.py +++ b/app/luclient.py @@ -65,12 +65,17 @@ def get_dds(filename): @luclient_blueprint.route('/get_icon_lot/') @login_required def get_icon_lot(id): - + if id is None: + redirect(url_for('luclient.unknown')) render_component_id = query_cdclient( 'select component_id from ComponentsRegistry where component_type = 2 and id = ?', [id], one=True - )[0] + ) + if render_component_id is not None: + render_component_id = render_component_id[0] + else: + return redirect(url_for('luclient.unknown')) # find the asset from rendercomponent given the component id filename = query_cdclient( diff --git a/app/templates/partials/charxml/_item_tooltip.html.j2 b/app/templates/partials/charxml/_item_tooltip.html.j2 index cf56499..46a165f 100644 --- a/app/templates/partials/charxml/_item_tooltip.html.j2 +++ b/app/templates/partials/charxml/_item_tooltip.html.j2 @@ -67,6 +67,6 @@ {% endif %} {%if inv_item.attr_c|int > 999 %} -
Count: {{ inv_item.attr_c }} +
Count: {{ inv_item.attr_c|numberFormat }} {% endif %}