From 69e2cdb85e069cbf61ba56499f2c4f71ea5dc4f7 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Tue, 29 Jul 2025 12:39:06 +1000 Subject: [PATCH] fix: Cast blocks in csv to int --- server.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server.py b/server.py index da574ae..5ceeccc 100644 --- a/server.py +++ b/server.py @@ -172,6 +172,13 @@ def bulk_upload_notifications(): domain = parts[0].strip() blocks = parts[1].strip() + try: + blocks = int(blocks) + if blocks <= 0: + return jsonify({"error": "Blocks must be a positive integer"}), 400 + except ValueError: + return jsonify({"error": "Invalid blocks value"}), 400 + notification_type = parts[2].strip().lower() # Normalize to lowercase # Find the notification type