from django.utils.translation import ugettext as _
from django.db.models import F
+from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from forum.models.action import ActionProxy
from forum.models import Award, Badge, ValidationHash
from forum import settings
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})
+ send_template_email([self.user], "auth/welcome_email.html", {'validation_code': hash})
def describe(self, viewer=None):
return _("%(user)s %(have_has)s joined the %(app_name)s Q&A community") % {
return Award.objects.get(user=user, badge=badge).action
else:
return Award.objects.get(user=user, node=node, badge=badge).action
- except:
+ except ObjectDoesNotExist:
return None
def describe(self, viewer=None):