diff --git a/hooks/pre_gen_project.py b/hooks/pre_gen_project.py index 61176630c..4f4378f58 100644 --- a/hooks/pre_gen_project.py +++ b/hooks/pre_gen_project.py @@ -17,6 +17,14 @@ INFO = "\x1b[1;33m [INFO]: " HINT = "\x1b[3;33m" SUCCESS = "\x1b[1;32m [SUCCESS]: " +# The content of this string is evaluated by Jinja, and plays an important role. +# It updates the cookiecutter context to trim leading and trailing spaces +# from domain/email values +""" +{{ cookiecutter.update({ "domain_name": cookiecutter.domain_name | trim }) }} +{{ cookiecutter.update({ "email": cookiecutter.email | trim }) }} +""" + project_slug = "{{ cookiecutter.project_slug }}" if hasattr(project_slug, "isidentifier"): assert ( @@ -80,8 +88,3 @@ if ( "Mail Service for sending emails." ) sys.exit(1) - -""" -{{ cookiecutter.update({ "domain_name": cookiecutter.domain_name | trim }) }} -{{ cookiecutter.update({ "email": cookiecutter.email | trim }) }} -"""