04/15 Updated Editing QR code page, QR code name is unchangeable

This commit is contained in:
2026-04-15 15:38:51 -04:00
parent 07c540c7f9
commit 7bee3bfedc
2 changed files with 228 additions and 301 deletions
+6 -4
View File
@@ -454,9 +454,11 @@ def edit_qr_code(qr_id):
'back_color': getattr(qr_code, 'back_color', '#FFFFFF')
}
# Update QR code fields
new_name = request.form['name']
qr_code.name = new_name
# QR code name is immutable after creation — always retain the existing value.
# The name field in the edit form is rendered read-only; this guard ensures
# the constraint is enforced even if the form is submitted programmatically.
new_name = qr_code.name # do not accept name changes from the form
# qr_code.name is intentionally NOT reassigned here
# --- ADDED: for dynamic QR codes, location/address are auto-managed ---
new_qr_type = request.form.get('qr_type', 'standard')
@@ -1196,4 +1198,4 @@ def deactivate_qr_code(qr_id):
return jsonify({
'success': False,
'message': 'Error deactivating QR code. Please try again.'
}), 500
}), 500