From a77d952aa6659f0291f856495b18a43dd7e28508 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Thu, 2 Jun 2011 09:02:13 -0500 Subject: [PATCH] No need for a method for generating the verification key as a method on the class, can just do that in the view --- mediagoblin/auth/views.py | 6 ++++-- mediagoblin/db/models.py | 8 -------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py index 0c125544..e9d75f8b 100644 --- a/mediagoblin/auth/views.py +++ b/mediagoblin/auth/views.py @@ -14,6 +14,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +import uuid + from webob import Response, exc from mediagoblin.db.util import ObjectId @@ -195,8 +197,8 @@ def resend_activation(request): Resend the activation email. """ - - request.user.generate_new_verification_key() + request.user['verification_key'] = unicode(uuid.uuid4()) + request.user.save() # Copied shamelessly from the register view above. diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index 0b85430a..3da97a49 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -64,14 +64,6 @@ 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' -- 2.25.1