--- a/src/pyams_security/principal.py Sat Feb 28 15:26:58 2015 +0100
+++ b/src/pyams_security/principal.py Sat Feb 28 15:28:02 2015 +0100
@@ -31,11 +31,12 @@
id = FieldProperty(IPrincipalInfo['id'])
title = FieldProperty(IPrincipalInfo['title'])
- groups = FieldProperty(IPrincipalInfo['groups'])
+ attributes = FieldProperty(IPrincipalInfo['attributes'])
def __init__(self, **kwargs):
- self.id = kwargs.get('id')
- self.title = kwargs.get('title')
+ self.id = kwargs.pop('id')
+ self.title = kwargs.pop('title', '__unknown__')
+ self.attributes = kwargs
def __eq__(self, other):
return isinstance(other, PrincipalInfo) and (self.id == other.id)
@@ -69,7 +70,7 @@
@property
def title(self):
- return 'MissingPrincipal: {0}'.format(self.id)
+ return 'MissingPrincipal: {id}'.format(id=self.id)
def __eq__(self, other):
return isinstance(other, PrincipalInfo) and (self.id == other.id)