user['status'] = u'active'
user['email_verified'] = True
user.save()
+ verification_successful = True
messages.add_message(request,
messages.SUCCESS,
'Your email address has been verified. ' \
'You may now login!')
else:
+ verification_successful = False
messages.add_message(request,
messages.ERROR,
'The verification key or user id is incorrect')
return render_to_response(
request,
'mediagoblin/user_pages/user.html',
- {'user': user})
+ {'user': user,
+ 'verification_successful' : verification_successful})
def resend_activation(request):
"/auth/verify_email/?userid=%s&token=total_bs" % unicode(
new_user['_id']))
context = util.TEMPLATE_TEST_CONTEXT[
- 'mediagoblin/auth/verify_email.html']
+ 'mediagoblin/user_pages/user.html']
assert context['verification_successful'] == False
new_user = mg_globals.database.User.find_one(
{'username': 'happygirl'})
util.clear_test_template_context()
test_app.get("%s?%s" % (path, get_params))
context = util.TEMPLATE_TEST_CONTEXT[
- 'mediagoblin/auth/verify_email.html']
+ 'mediagoblin/user_pages/user.html']
assert context['verification_successful'] == True
new_user = mg_globals.database.User.find_one(
{'username': 'happygirl'})