entities/authobjs.py
changeset 2784 f395115070c1
parent 2778 3f6dfc312760
child 3377 dd9d292b6a6d
--- a/entities/authobjs.py	Tue Aug 11 17:27:27 2009 +0200
+++ b/entities/authobjs.py	Wed Aug 12 18:05:19 2009 +0200
@@ -44,7 +44,7 @@
         try:
             return self._groups
         except AttributeError:
-            self._groups = set(g.cwdb.name for g in self.cwdb.in_group)
+            self._groups = set(g.name for g in self.in_group)
             return self._groups
 
     @property
@@ -52,8 +52,7 @@
         try:
             return self._properties
         except AttributeError:
-            self._properties = dict((p.cwdb.pkey, p.cwdb.value)
-                                    for p in self.cwdb.reverse_for_user)
+            self._properties = dict((p.pkey, p.value) for p in self.reverse_for_user)
             return self._properties
 
     def property_value(self, key):
@@ -64,8 +63,7 @@
         except KeyError:
             pass
         except ValueError:
-            self.warning('incorrect value for property %s of user %s', key,
-                         self.cwdb.login)
+            self.warning('incorrect value for eproperty %s of user %s', key, self.login)
         return self.vreg.property_value(key)
 
     def matching_groups(self, groups):
@@ -124,17 +122,16 @@
 
     def name(self):
         """construct a name using firstname / surname or login if not defined"""
-        surname = self.get_value('surname')
-        firstname = self.get_value('firstname')
-        if firstname and surname:
+
+        if self.firstname and self.surname:
             return self.req._('%(firstname)s %(surname)s') % {
-                'firstname': firstname, 'surname' : surname}
-        if firstname or surname:
-            return surname or firstname
-        return self.get_value('login')
+                'firstname': self.firstname, 'surname' : self.surname}
+        if self.firstname:
+            return self.firstname
+        return self.login
 
     def dc_title(self):
-        return self.get_value('login')
+        return self.login
 
     dc_long_title = name