[Backport] Fixing bulk update API call with empty arrays

remotes/origin/issue/4217/improving-mail-design
Alejandro Alonso 2016-10-02 17:38:41 +02:00
parent 7754d315f0
commit defdffe047
1 changed files with 3 additions and 0 deletions

View File

@ -130,6 +130,9 @@ def update_attr_in_bulk_for_ids(values, attr, model):
:params attr: attr to update :params attr: attr to update
:params model: Model of the ids. :params model: Model of the ids.
""" """
if not values:
return
values = [str((id, order)) for id, order in values.items()] values = [str((id, order)) for id, order in values.items()]
sql = """ sql = """
UPDATE "{tbl}" UPDATE "{tbl}"