Fix bug: not found exc. handler was failing for singleton objects

This commit is contained in:
Pavel Zuna 2010-08-09 19:50:15 -04:00 committed by Rob Crittenden
parent 6136f773a9
commit cc9d0ffc67

View File

@ -117,9 +117,12 @@ class LDAPObject(Object):
del entry_attrs[attr]
def handle_not_found(self, *keys):
pkey = ''
if self.primary_key:
pkey = keys[-1]
raise errors.NotFound(
reason=self.object_not_found_msg % {
'pkey': keys[-1], 'oname': self.object_name,
'pkey': pkey, 'oname': self.object_name,
}
)