From 3344480ffbd58d93937ab02a59d1a03ac507d7c0 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sun, 1 Dec 2013 22:34:45 -0600 Subject: [PATCH] Don't try to set password if it isn't passed in --- .../{{cookiecutter.repo_name}}/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/models.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/models.py index 85eadf4..7af7e9c 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/models.py +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/models.py @@ -19,7 +19,8 @@ class User(db.Model): def __init__(self, username=None, email=None, password=None): self.username = username self.email = email - self.set_password(password) + if password: + self.set_password(password) def set_password(self, password): self.password = pwd_context.encrypt(password)