Skip to content

Commit

Permalink
added verification for the project name in setup_project command
Browse files Browse the repository at this point in the history
  • Loading branch information
DNX committed Dec 20, 2011
1 parent b6c8e0e commit e77d92e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pinax/core/management/commands/setup_project.py
Expand Up @@ -91,7 +91,11 @@ def project_list(self):
def setup_project(self, destination, base, options):

user_project_name = os.path.basename(destination)


if not re.search(r'^\w+$', user_project_name):
sys.stderr.write("Error: %r is not a valid app name. Please use only numbers, letters and underscores.\n" % (user_project_name))
sys.exit(1)

if os.path.exists(destination):
raise CommandError("Destination path already exists [%s]" % destination)

Expand Down

0 comments on commit e77d92e

Please sign in to comment.