Exemplo n.º 1
0
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)
Exemplo n.º 2
0
 def language_context(self):
     from adhocracy import i18n
     return i18n.user_language(self.user)
Exemplo n.º 3
0
 def language_context(self):
     return i18n.user_language(self.user)
Exemplo n.º 4
0
 def language_context(self):
     return i18n.user_language(self.user)
Exemplo n.º 5
0
 def language_context(self):
     from adhocracy import i18n
     return i18n.user_language(self.user)