diff --git a/app.py b/app.py index ffe35e5..f0b2c34 100644 --- a/app.py +++ b/app.py @@ -20,7 +20,7 @@ app.config['BABEL_TRANSLATION_DIRECTORIES'] = 'translations' babel = Babel() # Version der App -APP_VERSION = "1.4.13" +APP_VERSION = "1.4.14" def add_cache_headers(response): """Fügt Cache-Control-Header hinzu, die den Back-Forward-Cache ermöglichen""" @@ -321,10 +321,13 @@ def stats(): session['stats_auth'] = True return redirect(url_for('stats')) else: - response = make_response(render_template('stats_login.html', error='Falsches Passwort!')) - return add_cache_headers(response) - response = make_response(render_template('stats_login.html', error=None)) - return add_cache_headers(response) + response = make_response(render_template('stats_login.html', error='Falsches Passwort!')) + return add_cache_headers(response) + else: + response = make_response(render_template('stats_login.html', error=None)) + return add_cache_headers(response) + + # Wenn authentifiziert, zeige Dashboard log_path = os.path.join('log', 'pageviews.log') pageviews, func_counts, func_counts_hourly, impressions_per_day, impressions_per_hour, api_counts, api_counts_hourly = parse_log_stats(log_path) response = make_response(render_template('stats_dashboard.html', pageviews=pageviews, func_counts=func_counts, func_counts_hourly=func_counts_hourly, impressions_per_day=impressions_per_day, impressions_per_hour=impressions_per_hour, api_counts=api_counts, api_counts_hourly=api_counts_hourly))