fixed restoration of class name

This commit is contained in:
Frédéric Péters 2008-12-16 11:19:22 +01:00
parent a73f3c0e32
commit e2a5a10e0d
1 changed files with 9 additions and 6 deletions

View File

@ -57,12 +57,6 @@ class InheritingIdentityStore(authentic.identities.IdentitiesStoreStorage):
return identity
return None
def get_filename(cls, filename, ignore_errors = False):
t = cls.get_filename(cls, filename, ignore_errors = ignore_errors)
if t:
t.__class__ = self.identity_class
return t
def add(self, identity):
# make sure identity class is the correct one, and get a new id
# appropriate for that class
@ -112,6 +106,15 @@ def get_collectivity_identity_class(collectivity_id):
self.__class__ = authentic.identities.Identity
authentic.identities.Identity.store(self)
self.__class__ = old_class
def get_filename(cls, filename, ignore_errors = False):
t = super(CollectivityIdentity, cls).get_filename(
filename, ignore_errors = ignore_errors)
if t:
t.__class__ = cls
return t
get_filename = classmethod(get_filename)
return CollectivityIdentity