forked from 0x2620/pandora
only commit if we have data
This commit is contained in:
parent
9f4cdb1f63
commit
aed67b9e42
1 changed files with 5 additions and 5 deletions
|
@ -42,11 +42,11 @@ def get_sequences(itemId):
|
||||||
v = ', '.join([isinstance(v, basestring) and "'%s'"%v or str(v)
|
v = ', '.join([isinstance(v, basestring) and "'%s'"%v or str(v)
|
||||||
for v in sequence.values()])
|
for v in sequence.values()])
|
||||||
values.append('(%s)'%v)
|
values.append('(%s)'%v)
|
||||||
|
if values:
|
||||||
cursor = connection.cursor()
|
cursor = connection.cursor()
|
||||||
sql = "INSERT INTO sequence_sequence (%s) VALUES %s" % (keys, ', '.join(values));
|
sql = "INSERT INTO sequence_sequence (%s) VALUES %s" % (keys, ', '.join(values));
|
||||||
cursor.execute(sql)
|
cursor.execute(sql)
|
||||||
transaction.commit_unless_managed()
|
transaction.commit_unless_managed()
|
||||||
|
|
||||||
@task(ignore_results=True, queue='encoding')
|
@task(ignore_results=True, queue='encoding')
|
||||||
def update_sequence_ids(itemId):
|
def update_sequence_ids(itemId):
|
||||||
|
|
Loading…
Reference in a new issue