From 5e6d82a83c1daa67a99c5a0ef175a7e63c877761 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 2 Mar 2006 05:45:19 +0000 Subject: [PATCH] magic-removal: Fixed #1436 -- Fixed typo in django-admin.py error messages. Thanks, akaihola git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2470 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/management.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/django/core/management.py b/django/core/management.py index db4eace2d9..4b1e0f377b 100644 --- a/django/core/management.py +++ b/django/core/management.py @@ -461,8 +461,7 @@ def install(app): "Executes the equivalent of 'get_sql_all' in the current database." from django.db import connection, transaction - app_name = app.__name__[app.__name__.rindex('.')+1:] - app_label = app_name.split('.')[-1] + app_name = app.__name__.split('.')[-2] # First, try validating the models. _check_for_validation_errors(app) @@ -479,8 +478,7 @@ def install(app): * At least one of the database tables already exists. * The SQL was invalid. Hint: Look at the output of 'django-admin.py sqlall %s'. That's the SQL this command wasn't able to run. -The full error: %s\n""" % \ - (app_name, app_label, e)) +The full error: %s\n""" % (app_name, app_name, e)) transaction.rollback_unless_managed() sys.exit(1) transaction.commit_unless_managed() @@ -491,8 +489,7 @@ def reset(app): "Executes the equivalent of 'get_sql_reset' in the current database." from django.db import connection, transaction from cStringIO import StringIO - app_name = app.__name__[app.__name__.rindex('.')+1:] - app_label = app_name.split('.')[-1] + app_name = app.__name__.split('.')[-2] # First, try validating the models. s = StringIO() @@ -521,8 +518,7 @@ Type 'yes' to continue, or 'no' to cancel: """) * At least one of the database tables already exists. * The SQL was invalid. Hint: Look at the output of 'django-admin.py sqlreset %s'. That's the SQL this command wasn't able to run. -The full error: %s\n""" % \ - (app_name, app_label, e)) +The full error: %s\n""" % (app_name, app_name, e)) transaction.rollback_unless_managed() sys.exit(1) transaction.commit_unless_managed()