From e2a5a10e0dc6a86b240c3f8c7f4f05ccc04ce918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Peters?= Date: Tue, 16 Dec 2008 11:19:22 +0100 Subject: [PATCH] fixed restoration of class name --- extra/modules/stores.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/extra/modules/stores.py b/extra/modules/stores.py index 6441974..1e6d625 100644 --- a/extra/modules/stores.py +++ b/extra/modules/stores.py @@ -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