From 1600e0e0e85c569a3063a42c789e8753d3ac9896 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 6 Jan 2016 13:27:54 +0100 Subject: [PATCH 4/5] agent/authentic2: provision role "details" (#9503) --- hobo/agent/authentic2/apps.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hobo/agent/authentic2/apps.py b/hobo/agent/authentic2/apps.py index a52423b..1fcb88f 100644 --- a/hobo/agent/authentic2/apps.py +++ b/hobo/agent/authentic2/apps.py @@ -60,9 +60,10 @@ def get_related_roles(role_or_through): for role in qs: role.emails = [] role.emails_to_members = False + role.details = u'' for attribute in role.attributes.all(): - if attribute.name in ('emails', 'emails_to_members') \ - and attribute.kind == 'json': + if (attribute.name in ('emails', 'emails_to_members', 'details') + and attribute.kind == 'json'): setattr(role, attribute.name, json.loads(attribute.value)) return qs @@ -85,6 +86,7 @@ def notify_roles(sender, instance, **kwargs): 'name': role.name, 'slug': role.slug, 'description': role.description, + 'details': role.details, 'emails': role.emails, 'emails_to_members': role.emails_to_members, } for role in get_related_roles(instance) @@ -199,7 +201,6 @@ class Authentic2AgentConfig(AppConfig): post_delete.connect(notify_roles, Role) post_save.connect(notify_roles, Role.members.through) post_delete.connect(notify_roles, Role.members.through) - User = get_user_model() post_save.connect(provision_user) post_delete.connect(deprovision_user) post_save.connect(provision_user_on_attribute_value_save, sender=AttributeValue) -- 2.1.4