From 85ba12f5042d0db6c1a7f6c27fa27b5ffd9ea227 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 30 Jun 2015 10:17:07 +0200 Subject: [PATCH] Add a CN attribute to pratic attributes --- src/authentic2_pratic/attribute_backend.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/authentic2_pratic/attribute_backend.py b/src/authentic2_pratic/attribute_backend.py index 39848ea..355f3e5 100644 --- a/src/authentic2_pratic/attribute_backend.py +++ b/src/authentic2_pratic/attribute_backend.py @@ -20,6 +20,7 @@ def get_attribute_names(instance, ctx): if field.name == 'user_ptr': continue yield 'pratic_' + field.name, field.verbose_name + yield 'pratic_cn', 'Nom complet' def get_dependencies(instance, ctx): return ('user',) @@ -33,4 +34,5 @@ def get_attributes(instance, ctx): if field.name == 'user_ptr': continue ctx['pratic_' + field.name] = getattr(user, field.name) + ctx['pratic_cn'] = user.first_name + ' ' + user.last_name return ctx