def handle_abuse_message(message): message = json.loads(message) admins = [] if message.get('instance'): instance = model.Instance.find(message.get('instance')) admins = get_instance_admins(instance) else: admins = get_global_admins() for admin in admins: i18n.user_language(admin) subject = _("Abuse report: %s") % message.get('url') body = _("%(user)s has reported abuse on the page %(url)s:" "\r\n\r\n%(message)s") body = body % message mail.to_user(admin, subject, body)
def language_context(self): from adhocracy import i18n return i18n.user_language(self.user)
def language_context(self): return i18n.user_language(self.user)