]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/actions/user.py
Fixes a bug happening when processing an user reputation more than once in the same...
[osqa.git] / forum / actions / user.py
index 6170a17904df06745b08582ca3df0a9f686a0c48..6c174cee2e92ed989feee691931b69115f702e28 100644 (file)
@@ -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)),