Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 41fbd35613a12d068d0d62ecc6b96ddb07609b2b 1 parent 9350945
@freakboy3742 freakboy3742 authored
Showing with 7 additions and 6 deletions.
  1. +7 −6 django/core/management.py
View
13 django/core/management.py
@@ -1405,12 +1405,13 @@ def load_data(fixture_labels, verbosity=1):
print "No %s fixture '%s' in %s." % \
(format, fixture_name, humanize(fixture_dir))
- sequence_sql = backend.get_sql_sequence_reset(style, models)
- if sequence_sql:
- if verbosity > 1:
- print "Resetting sequences"
- for line in sequence_sql:
- cursor.execute(line)
+ if count[0] > 0:
+ sequence_sql = backend.get_sql_sequence_reset(style, models)
+ if sequence_sql:
+ if verbosity > 1:
+ print "Resetting sequences"
+ for line in sequence_sql:
+ cursor.execute(line)
transaction.commit()
transaction.leave_transaction_management()
Please sign in to comment.
Something went wrong with that request. Please try again.