Fix hina_invitation template: body should have only 1 parameter (contact_name for {{1}} in body text), button parameter (event_id for {{1}} in URL) is handled separately via button_param_key
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
34b5d19064
commit
685d33c4fe
@ -81,16 +81,10 @@ def _fix_template_parameters():
|
||||
).first()
|
||||
|
||||
if template:
|
||||
# Correct body parameters to match what send_wedding_invitation_bulk sends
|
||||
correct_params = [
|
||||
"contact_name",
|
||||
"groom_name",
|
||||
"bride_name",
|
||||
"venue",
|
||||
"event_date",
|
||||
"event_time",
|
||||
"guest_link"
|
||||
]
|
||||
# Correct body parameters to match the template structure:
|
||||
# - Body has 1 placeholder {{1}} = contact_name
|
||||
# - Button has 1 placeholder {{1}} = event_id (handled separately via button_param_key)
|
||||
correct_params = ["contact_name"]
|
||||
|
||||
current_params = json.loads(template.body_params or "[]")
|
||||
if current_params != correct_params:
|
||||
@ -2056,16 +2050,10 @@ async def fix_templates(db: Session = Depends(get_db)):
|
||||
"message": "hina_invitation template not found in database"
|
||||
}
|
||||
|
||||
# Correct body parameters to match what send_wedding_invitation_bulk sends
|
||||
correct_params = [
|
||||
"contact_name",
|
||||
"groom_name",
|
||||
"bride_name",
|
||||
"venue",
|
||||
"event_date",
|
||||
"event_time",
|
||||
"guest_link"
|
||||
]
|
||||
# Correct body parameters to match the template structure:
|
||||
# - Body has 1 placeholder {{1}} = contact_name
|
||||
# - Button has 1 placeholder {{1}} = event_id (handled separately via button_param_key)
|
||||
correct_params = ["contact_name"]
|
||||
|
||||
old_params = template.body_params
|
||||
template.body_params = json.dumps(correct_params)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user