diff --git a/extra/modules/stores.py b/extra/modules/stores.py index 2fb722b..84ab850 100644 --- a/extra/modules/stores.py +++ b/extra/modules/stores.py @@ -63,6 +63,14 @@ class InheritingIdentityStore(authentic.identities.IdentitiesStoreStorage): 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 + identity.__class__ = self.identity_class + identity.id = identity.get_new_id() + authentic.identities.IdentitiesStoreStorage.add(self, identity) + + class ParthenayIdentityStore(InheritingIdentityStore): def get_identity_for_account(self, account): @@ -98,8 +106,10 @@ def get_collectivity_identity_class(collectivity_id): if not os.path.exists(objects_dir): os.mkdir(objects_dir) self._filename = os.path.join(self._names, fix_key(self.id)) + old_class = self.__class__ self.__class__ = authentic.identities.Identity authentic.identities.Identity.store(self) + self.__class__ = old_class return CollectivityIdentity