create directory if necessary

This commit is contained in:
Frédéric Péters 2008-12-12 12:37:05 +01:00
parent 8049f2c6f2
commit be5470c1be
1 changed files with 3 additions and 0 deletions

View File

@ -68,6 +68,9 @@ def get_collectivity_identity_class(collectivity_id):
class CollectivityIdentity(authentic.identities.Identity):
_names = 'identities-' + str(collectivity_id)
def store(self):
objects_dir = self.get_objects_dir()
if not os.path.exists(objects_dir):
os.mkdir(objects_dir)
self._filename = os.path.join(self._names, fix_key(self.id))
self.__class__ = authentic.identities.Identity
authentic.identities.Identity.store(self)