From db1a438f3e6f8c5c8cec20b9326a21baf4579306 Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Tue, 3 May 2011 19:49:39 +0200 Subject: Added functionality to support user email verification, email = TBD, verification = done. Signed-off-by: Joar Wandborg --- mediagoblin/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mediagoblin/models.py') diff --git a/mediagoblin/models.py b/mediagoblin/models.py index eef59ed4..62cab4a5 100644 --- a/mediagoblin/models.py +++ b/mediagoblin/models.py @@ -14,7 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -import datetime +import datetime, uuid from mongokit import Document, Set @@ -41,6 +41,7 @@ class User(Document): 'pw_hash': unicode, 'email_verified': bool, 'status': unicode, + 'verification_key': unicode } required_fields = ['username', 'created', 'pw_hash', 'email'] @@ -48,8 +49,8 @@ class User(Document): default_values = { 'created': datetime.datetime.utcnow, 'email_verified': False, - # TODO: shouldn't be active by default, must have email registration - 'status': u'active'} + 'status': u'needs_email_verification', + 'verification_key': unicode( uuid.uuid4() ) } def check_login(self, password): """ -- cgit v1.2.3