diff options
author | Joar Wandborg <git@wandborg.com> | 2011-05-03 19:49:39 +0200 |
---|---|---|
committer | Joar Wandborg <git@wandborg.com> | 2011-05-03 19:51:19 +0200 |
commit | db1a438f3e6f8c5c8cec20b9326a21baf4579306 (patch) | |
tree | d05b14111b863b62dd171e1b77411471e9e6db31 /mediagoblin/models.py | |
parent | 3dca2776a63886adcaac4bde188fb9ec8e74cfe2 (diff) | |
download | mediagoblin-db1a438f3e6f8c5c8cec20b9326a21baf4579306.tar.lz mediagoblin-db1a438f3e6f8c5c8cec20b9326a21baf4579306.tar.xz mediagoblin-db1a438f3e6f8c5c8cec20b9326a21baf4579306.zip |
Added functionality to support user email verification, email = TBD, verification = done.
Signed-off-by: Joar Wandborg <git@wandborg.com>
Diffstat (limited to 'mediagoblin/models.py')
-rw-r--r-- | mediagoblin/models.py | 7 |
1 files changed, 4 insertions, 3 deletions
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 <http://www.gnu.org/licenses/>. -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): """ |