aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/db/models.py')
-rw-r--r--mediagoblin/db/models.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py
index 3da97a49..0b85430a 100644
--- a/mediagoblin/db/models.py
+++ b/mediagoblin/db/models.py
@@ -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'