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
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))
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 *
@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}),