host=request.host,
uri=request.urlgen('mediagoblin.auth.verify_email'),
userid=unicode(user._id),
- verification_key=user['verification_key'])})
+ verification_key=user.verification_key)})
# TODO: There is no error handling in place
send_email(
user = request.db.User.find_one(
{'_id': ObjectId(unicode(request.GET['userid']))})
- if user and user['verification_key'] == unicode(request.GET['token']):
+ if user and user.verification_key == unicode(request.GET['token']):
user.status = u'active'
user.email_verified = True
- user[u'verification_key'] = None
+ user.verification_key = None
user.save()
return redirect(request, "mediagoblin.user_pages.user_home", user=request.user['username'])
- request.user[u'verification_key'] = unicode(uuid.uuid4())
+ request.user.verification_key = unicode(uuid.uuid4())
request.user.save()
email_debug_message(request)
assert parsed_get_params['userid'] == [
unicode(new_user._id)]
assert parsed_get_params['token'] == [
- new_user['verification_key']]
+ new_user.verification_key]
## Try verifying with bs verification key, shouldn't work
template.clear_test_template_context()