Permalink
Browse files

added verification for the project name in setup_project command

  • Loading branch information...
1 parent b6c8e0e commit e77d92e1ecaefa8c0a71a90b4cc4b49ec60813c4 DNX committed Dec 20, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 pinax/core/management/commands/setup_project.py
View
6 pinax/core/management/commands/setup_project.py
@@ -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)

0 comments on commit e77d92e

Please sign in to comment.