From ff577a6cbf94f9df0c15869cfc34bf70c8623b3b Mon Sep 17 00:00:00 2001 From: Javier Date: Sun, 25 Jan 2026 20:17:37 -0600 Subject: [PATCH] v0.11.0 - Added a block so no bins can be counted until a master file has been uploaded. --- app.py | 6 +++--- .../__pycache__/counting.cpython-313.pyc | Bin 23369 -> 23716 bytes .../__pycache__/data_imports.cpython-313.pyc | Bin 7458 -> 7432 bytes blueprints/counting.py | 6 ++++++ blueprints/data_imports.py | 2 +- templates/my_counts.html | 9 +++++++++ 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index c669e8e..8d70fcb 100644 --- a/app.py +++ b/app.py @@ -17,7 +17,7 @@ from blueprints.data_imports import data_imports_bp from blueprints.users import users_bp from blueprints.sessions import sessions_bp from blueprints.admin_locations import admin_locations_bp -from blueprints.counting import counting_bp # Add this import +from blueprints.counting import counting_bp from utils import login_required # Register Blueprints @@ -25,7 +25,7 @@ app.register_blueprint(data_imports_bp) app.register_blueprint(users_bp) app.register_blueprint(sessions_bp) app.register_blueprint(admin_locations_bp) -app.register_blueprint(counting_bp) # Add this registration +app.register_blueprint(counting_bp) # V1.0: Use environment variable for production, fallback to demo key for development app.secret_key = os.environ.get('SCANLOOK_SECRET_KEY', 'scanlook-demo-key-replace-for-production') @@ -36,7 +36,7 @@ app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(hours=1) # 1. Define the version -APP_VERSION = '0.10.0' +APP_VERSION = '0.11.0' # 2. Inject it into all templates automatically @app.context_processor diff --git a/blueprints/__pycache__/counting.cpython-313.pyc b/blueprints/__pycache__/counting.cpython-313.pyc index d337f5f28c2860b6990b82075b2898b26d65c8f8..07feb82f9470cfb5d92aadacea97d15a9af82d74 100644 GIT binary patch delta 2173 zcma)7ZERCj7{2HByX*JZ`T=xzZh;lXwsu>{a0{?44A^Q3cO4x=YuDb*i~U$mZ&4Qo zj3_7(Vosvq7$$`MF#a-EQ4@b))c6rUhLE5QiALiue?S89hbF}Ly{)Suel_XSb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-$8p|NBYO?5bPR~^p?Fzq=sal;(YCOi1QCKBf^`HN;M$5W_#rs3@=!gMJMEH? z0O6c$Feqv<2et;9S8Z|`?OUlrb^@kXEf8lhU{*V|N)Y@XP%`>TR4_wk;C!OiW>hl+ zKP8?JPowdY_E+Mt&~HqO_-715w9M^aUr(^)nesNnzAu?90croPj$%P2wjg-qgJ7HrP9j zE>gJe$AK7&@&>h_T6fV<(j^6Hk;rb6C@QWQEWGf|C5MJpCWXWlWDj5oP3~M~ zfeWv`g&w*?##1XZJUi@7%6bSP>ND;LgS@&gTVf2iD*fQXU?<4WxD;k61E1HOQ%v4> zpU5&<4-*_AC>L~;oJHF77j*{)z}YQL&XeRra8J9o<&w3=VC`yLo1|a~viHJggCF4~ zvTOj1=6#i_-`nfZCedJ0fh zd`fCbVrI_f2Jx%RJZ1;1E{gbF=Jvn9;=egjdNQL(0OMz72Br|kk4zqni~)>A{6ND2 DHT59p diff --git a/blueprints/counting.py b/blueprints/counting.py index 5872f1c..94bb7be 100644 --- a/blueprints/counting.py +++ b/blueprints/counting.py @@ -79,6 +79,9 @@ def start_bin_count(session_id): if not sess: flash('Session not found or archived', 'warning') return redirect(url_for('dashboard')) + if not sess['master_baseline_timestamp']: + flash('Master File not uploaded. Please upload it before starting bins.', 'warning') + return redirect(url_for('counting.my_counts', session_id=session_id)) location_name = request.form.get('location_name', '').strip().upper() @@ -144,6 +147,9 @@ def count_location(session_id, location_count_id): if not sess: flash('Session not found or archived', 'warning') return redirect(url_for('dashboard')) + if not sess['master_baseline_timestamp']: + flash('Master File not uploaded. Please upload it before starting bins.', 'warning') + return redirect(url_for('counting.my_counts', session_id=session_id)) location = query_db(''' SELECT * FROM LocationCounts diff --git a/blueprints/data_imports.py b/blueprints/data_imports.py index fcb802f..8ebd24b 100644 --- a/blueprints/data_imports.py +++ b/blueprints/data_imports.py @@ -152,4 +152,4 @@ def upload_master(session_id): finally: conn.close() - return redirect(url_for('sessions. session_detail', session_id=session_id)) \ No newline at end of file + return redirect(url_for('sessions.session_detail', session_id=session_id)) \ No newline at end of file diff --git a/templates/my_counts.html b/templates/my_counts.html index 5265fde..e6d2b1a 100644 --- a/templates/my_counts.html +++ b/templates/my_counts.html @@ -9,10 +9,19 @@ ← Back to Dashboard

My Active Counts

{{ count_session.session_name }}

+ {% if not count_session.master_baseline_timestamp %} +

Master File not uploaded yet. Please contact an admin before starting bins.

+ {% endif %} + {% if count_session.master_baseline_timestamp %} + {% else %} + + {% endif %}