From 51dcb049cf9b2854be3d7b985daf0a2a98313db5 Mon Sep 17 00:00:00 2001 From: Charlie Jacomme Date: Tue, 7 Aug 2018 19:58:19 +0200 Subject: [PATCH] update templates for new re2o names --- main.py | 2 +- templates/list | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 11bf6e0..f61f773 100755 --- a/main.py +++ b/main.py @@ -22,7 +22,7 @@ api_client = Re2oAPIClient(api_hostname, api_username, api_password) client_hostname = socket.gethostname().split('.', 1)[0] -all_users = api_client.list("mail/alias") +all_users = api_client.list("localemail/users") # Création de l'environnement Jinja env = Environment(loader=FileSystemLoader('.')) diff --git a/templates/list b/templates/list index ff577f3..b88a55a 100644 --- a/templates/list +++ b/templates/list @@ -1,10 +1,10 @@ # Liste d'association alias:addresse des users {%- for user in data -%} -{%- for alias in user.get_mail_aliases -%} -{%- if user.redirection -%} -{{alias.valeur}}:{{ user.get_mail }} +{%- for alias in user.email_address -%} +{%- if user.local_email_redirect -%} +{{alias.complete_email_address}}:{{ user.email }} {%- else -%} -{{alias.valeur}}:{{ user.pseudo }} +{{alias.complete_email_address}}:{{ alias.user }} {% endif %} {% endfor %} {% endfor %}