Instead of creating the email verication key on the db
model as a default for the field, create it in the
registration view.
Now all verification key generation is only in
auth/views.py!
user.email = email
user.pw_hash = auth_lib.bcrypt_gen_password_hash(
request.POST['password'])
+ user.verification_key = unicode(uuid.uuid4())
user.save(validate=True)
# log the user in
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import datetime
-import uuid
from mongokit import Document
'created': datetime.datetime.utcnow,
'email_verified': False,
'status': u'needs_email_verification',
- 'verification_key': lambda: unicode(uuid.uuid4()),
'is_admin': False}
def check_login(self, password):