Ensure email_recipients is always a list

This commit is contained in:
Joshua Boniface 2024-08-25 16:18:19 -04:00
parent 8ca6976892
commit de58efdaa9
1 changed files with 5 additions and 1 deletions

View File

@ -3559,10 +3559,14 @@ class API_VM_Autobackup_Root(Resource):
id: Message
"""
email_recipients = reqargs.get("email_recipients", None)
if email_recipients is not None and not isinstance(email_recipients, list):
email_recipients = [email_recipients]
task = run_celery_task(
"cluster.autobackup",
force_full=reqargs.get("force_full", False),
email_recipients=reqargs.get("email_recipients", None),
email_recipients=email_recipients,
run_on="primary",
)
return (