04/15 Updated Editing QR code page, QR code name is unchangeable
This commit is contained in:
+6
-4
@@ -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
|
||||
Reference in New Issue
Block a user