Fix nested form breaking Mark Paid & Deliver button
This commit is contained in:
parent
8175327ce3
commit
0c79984619
2 changed files with 6 additions and 10 deletions
2
app.py
2
app.py
|
|
@ -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))
|
||||||
|
|
|
||||||
|
|
@ -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">
|
|
||||||
<input type="hidden" name="action" value="save_delivery_options">
|
|
||||||
<label for="deliver_wav" style="display:flex;align-items:center;gap:.5rem;cursor:pointer;">
|
<label for="deliver_wav" style="display:flex;align-items:center;gap:.5rem;cursor:pointer;">
|
||||||
<input type="checkbox" id="deliver_wav" name="deliver_wav" value="1" {% if req.deliver_wav %}checked{% endif %} style="width:auto;margin:0">
|
<input type="checkbox" id="deliver_wav" name="deliver_wav" value="1" {% if req.deliver_wav %}checked{% endif %} style="width:auto;margin:0">
|
||||||
Include WAV files in delivery email
|
Include WAV files in delivery email
|
||||||
</label>
|
</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">
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue