sql: don't run any query if there are no evolution to load
This commit is contained in:
parent
0b455795ed
commit
f701116882
|
@ -893,6 +893,8 @@ class SqlFormData(SqlMixin, wcs.formdata.FormData):
|
|||
# on a serie of formdata and in that case, it's more efficient to
|
||||
# optimize the process loading all evolutions in a single batch query.
|
||||
object_dict = dict([(x.id, x) for x in values if x.id and x._evolution is None])
|
||||
if not object_dict:
|
||||
return
|
||||
conn, cur = get_connection_and_cursor()
|
||||
sql_statement = '''SELECT id, who, status, time, comment, parts, formdata_id
|
||||
FROM %s_evolutions''' % cls._table_name
|
||||
|
|
Loading…
Reference in New Issue