From e91c058cd718fea25e38181098b1d0eb2ccf64cd Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 6 Sep 2013 17:33:19 -0500 Subject: Registration form validaiton without js works --- wqflask/secure_server.py | 2 +- wqflask/wqflask/model.py | 8 +++--- .../static/new/js_external/zxcvbn/zxcvbn-async.js | 1 + .../templates/new_security/register_user.html | 25 ++++++++++------ wqflask/wqflask/user_manager.py | 33 ++++++++++++++++++++++ wqflask/wqflask/views.py | 30 ++++++++++++++++++-- 6 files changed, 83 insertions(+), 16 deletions(-) create mode 100644 wqflask/wqflask/static/new/js_external/zxcvbn/zxcvbn-async.js diff --git a/wqflask/secure_server.py b/wqflask/secure_server.py index 697ebfe0..df195bd2 100644 --- a/wqflask/secure_server.py +++ b/wqflask/secure_server.py @@ -36,4 +36,4 @@ if __name__ == '__main__': port=app.config['SERVER_PORT'], use_debugger=False, threaded=True, - use_reloader=False) + use_reloader=True) diff --git a/wqflask/wqflask/model.py b/wqflask/wqflask/model.py index c1b8d060..b3dfe746 100644 --- a/wqflask/wqflask/model.py +++ b/wqflask/wqflask/model.py @@ -47,11 +47,11 @@ class Role(db.Model, RoleMixin): class User(db.Model, UserMixin): id = db.Column(db.Integer(), primary_key=True) - email = db.Column(db.String(255), unique=True) - password = db.Column(db.String(255)) + email = db.Column(db.String(50), unique=True) + password = db.Column(db.String(50)) - name = db.Column(db.Unicode(255)) - organization = db.Column(db.Unicode(255)) + full_name = db.Column(db.Unicode(50)) + organization = db.Column(db.Unicode(50)) active = db.Column(db.Boolean()) confirmed_at = db.Column(db.DateTime()) diff --git a/wqflask/wqflask/static/new/js_external/zxcvbn/zxcvbn-async.js b/wqflask/wqflask/static/new/js_external/zxcvbn/zxcvbn-async.js new file mode 100644 index 00000000..404944d3 --- /dev/null +++ b/wqflask/wqflask/static/new/js_external/zxcvbn/zxcvbn-async.js @@ -0,0 +1 @@ +(function(){var a;a=function(){var a,b;b=document.createElement("script");b.src="//dl.dropbox.com/u/209/zxcvbn/zxcvbn.js";b.type="text/javascript";b.async=!0;a=document.getElementsByTagName("script")[0];return a.parentNode.insertBefore(b,a)};null!=window.attachEvent?window.attachEvent("onload",a):window.addEventListener("load",a,!1)}).call(this); diff --git a/wqflask/wqflask/templates/new_security/register_user.html b/wqflask/wqflask/templates/new_security/register_user.html index d203d65f..6a7f4c9c 100644 --- a/wqflask/wqflask/templates/new_security/register_user.html +++ b/wqflask/wqflask/templates/new_security/register_user.html @@ -28,15 +28,26 @@