Fix nested form breaking Mark Paid & Deliver button

This commit is contained in:
Troll (Hermes Agent) 2026-08-11 03:10:17 +00:00
parent 8175327ce3
commit 0c79984619
2 changed files with 6 additions and 10 deletions

2
app.py
View file

@ -1142,6 +1142,8 @@ def admin_request(rid):
elif action == 'mark_paid_deliver': elif action == 'mark_paid_deliver':
# Finalize: record Square payment ref, attach approved MP3s, email customer. # Finalize: record Square payment ref, attach approved MP3s, email customer.
# Also capture the deliver_wav checkbox from the same form.
update_request(rid, deliver_wav=1 if request.form.get('deliver_wav') else 0)
if req.get('customer_approved', 'none') == 'none': if req.get('customer_approved', 'none') == 'none':
flash('Customer must approve a version before you can mark paid or deliver.', 'error') flash('Customer must approve a version before you can mark paid or deliver.', 'error')
return redirect(url_for('admin_request', rid=rid)) return redirect(url_for('admin_request', rid=rid))

View file

@ -537,16 +537,10 @@
<hr style="border-color:#374151;margin:1rem 0"> <hr style="border-color:#374151;margin:1rem 0">
<p style="color:#93c5fd;font-weight:600">Delivery options:</p> <p style="color:#93c5fd;font-weight:600">Delivery options:</p>
<form method="POST" style="margin-bottom:.5rem"> <label for="deliver_wav" style="display:flex;align-items:center;gap:.5rem;cursor:pointer;">
<input type="hidden" name="action" value="save_delivery_options"> <input type="checkbox" id="deliver_wav" name="deliver_wav" value="1" {% if req.deliver_wav %}checked{% endif %} style="width:auto;margin:0">
<label for="deliver_wav" style="display:flex;align-items:center;gap:.5rem;cursor:pointer;"> Include WAV files in delivery email
<input type="checkbox" id="deliver_wav" name="deliver_wav" value="1" {% if req.deliver_wav %}checked{% endif %} style="width:auto;margin:0"> </label>
Include WAV files in delivery email
</label>
<div class="actions">
<button type="submit" class="secondary">Save Delivery Options</button>
</div>
</form>
<hr style="border-color:#374151;margin:1rem 0"> <hr style="border-color:#374151;margin:1rem 0">