Do lazy LDAP schema retrieval in json handler.

It was possible to get to this point without a schema if the first
handled request resulted in a Kerberos error.

https://fedorahosted.org/freeipa/ticket/1354
This commit is contained in:
Rob Crittenden 2011-06-21 16:05:11 -04:00 committed by Adam Young
parent f47ec11727
commit 1aee9df3bc

View File

@ -380,6 +380,7 @@ class LDAPObject(Object):
def __json__(self):
ldap = self.backend
ldap.get_schema()
json_dict = dict(
(a, getattr(self, a)) for a in self.json_friendly_attributes
)