X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/b1c8df390750f696ba75cdc3220db589d5a49d21..01eed1521a67afc04a8112b44ca4cd1c4a32cf00:/forum/actions/user.py diff --git a/forum/actions/user.py b/forum/actions/user.py index 6170a17..6c174ce 100644 --- a/forum/actions/user.py +++ b/forum/actions/user.py @@ -1,14 +1,19 @@ from django.utils.translation import ugettext as _ from django.db.models import F from forum.models.action import ActionProxy -from forum.models import Award, Badge +from forum.models import Award, Badge, ValidationHash from forum import settings from forum.settings import APP_SHORT_NAME +from forum.utils.mail import send_email, send_template_email class UserJoinsAction(ActionProxy): def repute_users(self): self.repute(self.user, int(settings.INITIAL_REP)) + def process_action(self): + hash = ValidationHash.objects.create_new(self.user, 'email', [self.user.email]) + send_template_email([self.user], "auth/email_validation.html", {'validation_code': hash}) + def describe(self, viewer=None): return _("%(user)s as joined the %(app_name)s Q&A community") % { 'user': self.hyperlink(self.user.get_profile_url(), self.friendly_username(viewer, self.user)),