Loading django/core/management/commands/syncdb.py +12 −14 Original line number Diff line number Diff line Loading @@ -121,8 +121,8 @@ class Command(NoArgsCommand): if custom_sql: if verbosity >= 2: self.stdout.write("Installing custom SQL for %s.%s model\n" % (app_name, model._meta.object_name)) with transaction.commit_on_success_unless_managed(using=db): try: with transaction.commit_on_success_unless_managed(using=db): for sql in custom_sql: cursor.execute(sql) except Exception as e: Loading @@ -130,7 +130,6 @@ class Command(NoArgsCommand): (app_name, model._meta.object_name, e)) if show_traceback: traceback.print_exc() raise else: if verbosity >= 3: self.stdout.write("No custom SQL for %s.%s model\n" % (app_name, model._meta.object_name)) Loading @@ -145,14 +144,13 @@ class Command(NoArgsCommand): if index_sql: if verbosity >= 2: self.stdout.write("Installing index for %s.%s model\n" % (app_name, model._meta.object_name)) with transaction.commit_on_success_unless_managed(using=db): try: with transaction.commit_on_success_unless_managed(using=db): for sql in index_sql: cursor.execute(sql) except Exception as e: self.stderr.write("Failed to install index for %s.%s model: %s\n" % \ (app_name, model._meta.object_name, e)) raise # Load initial_data fixtures (unless that has been disabled) if load_initial_data: Loading Loading
django/core/management/commands/syncdb.py +12 −14 Original line number Diff line number Diff line Loading @@ -121,8 +121,8 @@ class Command(NoArgsCommand): if custom_sql: if verbosity >= 2: self.stdout.write("Installing custom SQL for %s.%s model\n" % (app_name, model._meta.object_name)) with transaction.commit_on_success_unless_managed(using=db): try: with transaction.commit_on_success_unless_managed(using=db): for sql in custom_sql: cursor.execute(sql) except Exception as e: Loading @@ -130,7 +130,6 @@ class Command(NoArgsCommand): (app_name, model._meta.object_name, e)) if show_traceback: traceback.print_exc() raise else: if verbosity >= 3: self.stdout.write("No custom SQL for %s.%s model\n" % (app_name, model._meta.object_name)) Loading @@ -145,14 +144,13 @@ class Command(NoArgsCommand): if index_sql: if verbosity >= 2: self.stdout.write("Installing index for %s.%s model\n" % (app_name, model._meta.object_name)) with transaction.commit_on_success_unless_managed(using=db): try: with transaction.commit_on_success_unless_managed(using=db): for sql in index_sql: cursor.execute(sql) except Exception as e: self.stderr.write("Failed to install index for %s.%s model: %s\n" % \ (app_name, model._meta.object_name, e)) raise # Load initial_data fixtures (unless that has been disabled) if load_initial_data: Loading