Merge branch 'gullydwarf-cfdv-f357_lost_password_functionality'

Conflicts:
	mediagoblin/auth/routing.py
This commit is contained in:
Christopher Allan Webber
2011-09-08 08:12:43 -05:00
13 changed files with 482 additions and 11 deletions

View File

@@ -92,3 +92,18 @@ def mediaentry_add_fail_error_and_metadata(database):
{'fail_metadata': {'$exists': False}},
{'$set': {'fail_metadata': {}}},
multi=True)
@RegisterMigration(6)
def user_add_forgot_password_token_and_expires(database):
"""
Add token and expiration fields to help recover forgotten passwords
"""
database['users'].update(
{'fp_verification_key': {'$exists': False}},
{'$set': {'fp_verification_key': None}},
multi=True)
database['users'].update(
{'fp_token_expire': {'$exists': False}},
{'$set': {'fp_token_expire': None}},
multi=True)

View File

@@ -78,6 +78,8 @@ class User(Document):
'url' : unicode,
'bio' : unicode, # May contain markdown
'bio_html': unicode, # May contain plaintext, or HTML
'fp_verification_key': unicode, # forgotten password verification key
'fp_token_expire': datetime.datetime
}
required_fields = ['username', 'created', 'pw_hash', 'email']