Added the ability to regenerate a verification key.

This commit is contained in:
Aleksandar Micovic
2011-05-31 17:14:23 -04:00
parent bcec749b52
commit b93a6a229e
4 changed files with 53 additions and 2 deletions

View File

@@ -64,6 +64,14 @@ class User(Document):
return auth_lib.bcrypt_check_password(
password, self['pw_hash'])
def generate_new_verification_key(self):
"""
Create a new verification key, overwriting the old one.
"""
self['verification_key'] = unicode(uuid.uuid4())
self.save(validate=False)
class MediaEntry(Document):
__collection__ = 'media_entries'