mirror of
https://github.com/django/django.git
synced 2025-04-25 09:44:36 +00:00
Added check to prevent sequence reset if no fixtures are loaded.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5234 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
9350945963
commit
41fbd35613
@ -1405,12 +1405,13 @@ def load_data(fixture_labels, verbosity=1):
|
|||||||
print "No %s fixture '%s' in %s." % \
|
print "No %s fixture '%s' in %s." % \
|
||||||
(format, fixture_name, humanize(fixture_dir))
|
(format, fixture_name, humanize(fixture_dir))
|
||||||
|
|
||||||
sequence_sql = backend.get_sql_sequence_reset(style, models)
|
if count[0] > 0:
|
||||||
if sequence_sql:
|
sequence_sql = backend.get_sql_sequence_reset(style, models)
|
||||||
if verbosity > 1:
|
if sequence_sql:
|
||||||
print "Resetting sequences"
|
if verbosity > 1:
|
||||||
for line in sequence_sql:
|
print "Resetting sequences"
|
||||||
cursor.execute(line)
|
for line in sequence_sql:
|
||||||
|
cursor.execute(line)
|
||||||
|
|
||||||
transaction.commit()
|
transaction.commit()
|
||||||
transaction.leave_transaction_management()
|
transaction.leave_transaction_management()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user