Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #3846 -- Fixed misleading variable name in 'startapp' code. Tha…

…nks, MarioGonzalez

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4989 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4326de3fc1871741d9cdd4baeb81576cfb7ce398 1 parent a02e13c
Adrian Holovaty authored

Showing 1 changed file with 4 additions and 3 deletions. Show diff stats Hide diff stats

  1. 7  django/core/management.py
7  django/core/management.py
@@ -789,11 +789,12 @@ def startapp(app_name, directory):
789 789
     # Determine the project_name a bit naively -- by looking at the name of
790 790
     # the parent directory.
791 791
     project_dir = os.path.normpath(os.path.join(directory, '..'))
792  
-    project_name = os.path.basename(project_dir)
793  
-    if app_name == os.path.basename(directory):
  792
+    parent_dir = os.path.basename(project_dir)
  793
+    project_name = os.path.basename(directory)
  794
+    if app_name == project_name:
794 795
         sys.stderr.write(style.ERROR("Error: You cannot create an app with the same name (%r) as your project.\n" % app_name))
795 796
         sys.exit(1)
796  
-    _start_helper('app', app_name, directory, project_name)
  797
+    _start_helper('app', app_name, directory, parent_dir)
797 798
 startapp.help_doc = "Creates a Django app directory structure for the given app name in the current directory."
798 799
 startapp.args = "[appname]"
799 800
 

0 notes on commit 4326de3

Please sign in to comment.
Something went wrong with that request. Please try again.