]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/actions/user.py
show information about the badge you just got in the message notification instead...
[osqa.git] / forum / actions / user.py
index 3366a6cf360fc212ff4401e541f499ef332d6219..94c9f1704fba8bc6e4fbf361692da4c15cd1def7 100644 (file)
@@ -1,4 +1,5 @@
 from django.utils.translation import ungettext, ugettext as _
+from django.core.urlresolvers import reverse
 from django.db.models import F
 from forum.models.action import ActionProxy
 from forum.models import Award, Badge, ValidationHash, User
@@ -46,7 +47,7 @@ class EmailValidationAction(ActionProxy):
         return _("%(user)s %(have_has)s validated the e-mail %(email)s") % {
         'user': self.hyperlink(self.user.get_profile_url(), self.friendly_username(viewer, self.user)),
         'have_has': self.viewer_or_user_verb(viewer, self.user, _('have'), _('has')),
-        'email' : self.user.email
+        'email' : self.user.email if viewer.is_superuser or viewer.is_staff or viewer == self.user else ""
         }
 
 class EditProfileAction(ActionProxy):
@@ -163,9 +164,10 @@ class AwardAction(ActionProxy):
         self.user.save()
 
         self.user.message_set.create(message=_(
-                """Congratulations, you have received a badge '%(badge_name)s'. Check out <a href=\"%(profile_url)s\">your profile</a>."""
-                ) %
-        dict(badge_name=award.badge.name, profile_url=self.user.get_profile_url()))
+                """Congratulations, you have received a badge '%(badge_name)s'. <a href="%(badges_url)s">Find out who has it, too</a>."""
+        ) % dict(
+            badge_name=award.badge.name,
+            badges_url=reverse("badges")))
 
     def cancel_action(self):
         award = self.award