Make all customer info fields editable from admin request page
This commit is contained in:
parent
da917692f0
commit
0c90b5a298
2 changed files with 40 additions and 8 deletions
17
app.py
17
app.py
|
|
@ -841,6 +841,23 @@ def admin_request(rid):
|
|||
flash('Customer email updated.', 'success')
|
||||
return redirect(url_for('admin_request', rid=rid))
|
||||
|
||||
elif action == 'update_customer_info':
|
||||
new_email = request.form.get('email', '').strip().lower()
|
||||
if not is_valid_email(new_email):
|
||||
flash('Please enter a valid email address.', 'error')
|
||||
return redirect(url_for('admin_request', rid=rid))
|
||||
update_request(rid,
|
||||
email=new_email,
|
||||
name=request.form.get('name', '').strip(),
|
||||
hobbies=request.form.get('hobbies', '').strip(),
|
||||
notable_facts=request.form.get('notable_facts', '').strip(),
|
||||
style_genre=request.form.get('style_genre', '').strip(),
|
||||
vocal_gender=request.form.get('vocal_gender', '').strip(),
|
||||
extra_requests=request.form.get('extra_requests', '').strip()
|
||||
)
|
||||
flash('Customer info updated.', 'success')
|
||||
return redirect(url_for('admin_request', rid=rid))
|
||||
|
||||
elif action == 'save_operator_notes':
|
||||
update_request(rid, operator_notes=request.form.get('operator_notes', '').strip())
|
||||
flash('Operator notes saved.', 'success')
|
||||
|
|
|
|||
Reference in a new issue