Add required pronouns dropdown and fix admin vocal gender selector
- Added a required Pronouns dropdown to /request and /admin/request: He/Him/His, She/Her/Hers, They/Them/Their. - Moved Email to the top of the customer request form; Pronouns sit just below Name. - Added column to the requests schema with automatic migration. - Stored pronouns are included in confirmation emails and Hermes prompt copy. - Fixed /admin/request so Preferred singer voice / gender is a dropdown matching the customer form instead of a free-text input. - Updated README to describe pronouns and the structured style selectors. Bumps version to 0.4.7.
This commit is contained in:
parent
10ee182558
commit
3f7bbf4b12
6 changed files with 65 additions and 17 deletions
11
models.py
11
models.py
|
|
@ -33,6 +33,7 @@ CREATE TABLE IF NOT EXISTS requests (
|
|||
hobbies TEXT,
|
||||
notable_facts TEXT,
|
||||
style_genre TEXT,
|
||||
pronouns TEXT,
|
||||
extra_requests TEXT,
|
||||
status TEXT DEFAULT 'pending',
|
||||
suno_title TEXT,
|
||||
|
|
@ -101,7 +102,7 @@ def init_db():
|
|||
expected_columns = {
|
||||
'requests': [
|
||||
'id', 'created_at', 'name', 'email', 'hobbies', 'notable_facts',
|
||||
'style_genre', 'extra_requests', 'status', 'suno_title', 'suno_style',
|
||||
'style_genre', 'pronouns', 'extra_requests', 'status', 'suno_title', 'suno_style',
|
||||
'suno_lyrics', 'song_a_path', 'song_b_path', 'vocal_gender',
|
||||
'customer_approved', 'approval_notified_at', 'preview_sent_at',
|
||||
'delivery_sent_at', 'square_payment_ref', 'admin_alert_email',
|
||||
|
|
@ -134,7 +135,7 @@ def now_utc():
|
|||
return datetime.now(timezone.utc).isoformat()
|
||||
|
||||
|
||||
def create_request(name, email, hobbies, notable_facts, style_genre, extra_requests, vocal_gender=None):
|
||||
def create_request(name, email, hobbies, notable_facts, style_genre, extra_requests, vocal_gender=None, pronouns=None):
|
||||
"""
|
||||
Insert a new customer request.
|
||||
Returns the auto-generated request id.
|
||||
|
|
@ -142,9 +143,9 @@ def create_request(name, email, hobbies, notable_facts, style_genre, extra_reque
|
|||
db = get_db()
|
||||
cur = db.execute(
|
||||
"""INSERT INTO requests
|
||||
(name, email, hobbies, notable_facts, style_genre, extra_requests, vocal_gender, player_token)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?)""",
|
||||
(name, email, hobbies, notable_facts, style_genre, extra_requests, vocal_gender, new_token())
|
||||
(name, email, hobbies, notable_facts, style_genre, pronouns, extra_requests, vocal_gender, player_token)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)""",
|
||||
(name, email, hobbies, notable_facts, style_genre, pronouns, extra_requests, vocal_gender, new_token())
|
||||
)
|
||||
db.commit()
|
||||
return cur.lastrowid
|
||||
|
|
|
|||
Reference in a new issue