]> git.openstreetmap.org Git - osqa.git/commitdiff
reintegrate merge hernani -> trunk
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Sun, 13 Mar 2011 13:33:31 +0000 (13:33 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Sun, 13 Mar 2011 13:33:31 +0000 (13:33 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@833 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/views/auth.py
forum/views/readers.py

index f17d6d21b76abaf87a95c1330254387ac7574c69..38243ed191cdd51324310edd9d717db23812481a 100644 (file)
@@ -27,9 +27,7 @@ from forum.authentication.base import InvalidAuthentication
 from forum.authentication import AUTH_PROVIDERS
 
 from forum.models import AuthKeyUserAssociation, ValidationHash, Question, Answer
-from forum.actions import UserJoinsAction, EmailValidationAction
-from forum.models.action import ActionRepute
-
+from forum.actions import UserJoinsAction
 
 from forum.settings import REP_GAIN_BY_EMAIL_VALIDATION
 from vars import ON_SIGNIN_SESSION_ATTR, PENDING_SUBMISSION_SESSION_ATTR
@@ -304,14 +302,9 @@ def validate_email(request, user, code):
     user = get_object_or_404(User, id=user)
 
     if (ValidationHash.objects.validate(code, user, 'email', [user.email])):
-        EmailValidationAction(user=user, ip=request.META['REMOTE_ADDR']).save()
-        if REP_GAIN_BY_EMAIL_VALIDATION > 0:
-            message = _("Thank you, your email is now validated and you've got %d points." % int(REP_GAIN_BY_EMAIL_VALIDATION))
-
-        else:
-            message = _("Thank you, your email is now validated.")
-
-        return login_and_forward(request, user, reverse('index'), message)
+        user.email_isvalid = True
+        user.save()
+        return login_and_forward(request, user, reverse('index'), _("Thank you, your email is now validated."))
     else:
         return render_to_response('auth/mail_already_validated.html', { 'user' : user }, RequestContext(request))
 
index 991a6b65bec77d17b156338ce723838a3599b6b1..8d2cd85f43b2eb112484dca9737cd8b3b842a87e 100644 (file)
@@ -6,7 +6,6 @@ from forum import settings as django_settings
 from django.shortcuts import render_to_response, get_object_or_404
 from django.http import HttpResponseRedirect, HttpResponse, Http404, HttpResponsePermanentRedirect
 from django.core.paginator import Paginator, EmptyPage, InvalidPage
-from django.core.exceptions import ObjectDoesNotExist
 from django.template import RequestContext
 from django import template
 from django.utils.html import *
@@ -102,13 +101,11 @@ def questions(request):
 
 @decorators.render('questions.html')
 def tag(request, tag):
-
     try:
         tag = Tag.active.get(name=unquote(tag))
     except Tag.DoesNotExist:
         raise Http404
 
-
     return question_list(request,
                          Question.objects.filter(tags=tag),
                          mark_safe(_('questions tagged <span class="tag">%(tag)s</span>') % {'tag': tag}),