X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/bca0a202e4e6b81d5520949c928e8c81c9cf1fb5..9a075e7d95c3b16c05011410de59196caaa86e66:/forum/actions/user.py diff --git a/forum/actions/user.py b/forum/actions/user.py index d9c6be9..7d636be 100644 --- a/forum/actions/user.py +++ b/forum/actions/user.py @@ -193,6 +193,35 @@ class AwardAction(ActionProxy): 'badge_name': self.award.badge.name, } + +class ReportAction(ActionProxy): + verb = _("suspended") + + def process_data(self, **kwargs): + self.extra = kwargs + # message here? + + + def process_action(self): + + all_superusers = User.objects.filter(is_superuser=True) + + + send_template_email(all_superusers, "notifications/user_reported.html", { + 'reported': self.extra['reported'], + 'user':self.user, + 'message': self.extra['publicmsg'] + } + ) + + def describe(self, viewer=None): + + return _("%(user)s reported %(reported) : %(msg)s") % { + 'user': self.hyperlink(self.user.get_profile_url(), self.friendly_username(viewer, self.user)), + 'reporter': self.extra.get('reported').username, + 'msg': self.extra.get('publicmsg', _('N/A')) + } + class SuspendAction(ActionProxy): verb = _("suspended")