Commits

Shay Erlichmen committed 913acfa

only init the temp file if file store is used

Comments (0)

Files changed (1)

openid_provider/conf.py

 import os
-import tempfile
 from django.conf import settings
 
-tempdir = tempfile.gettempdir()
-
 STORE = getattr(settings, 'OPENID_PROVIDER_STORE',
                 'openid.store.filestore.FileOpenIDStore')
 
-FILESTORE_PATH = getattr(settings, 'OPENID_PROVIDER_FILESTORE_PATH',
-                         os.path.join(tempdir, 'openid-filestore'))
+if STORE == 'openid.store.filestore.FileOpenIDStore':
+    import tempfile
+    tempdir = tempfile.gettempdir()
+    
+    FILESTORE_PATH = getattr(settings, 'OPENID_PROVIDER_FILESTORE_PATH',
+                             os.path.join(tempdir, 'openid-filestore'))
 
 SREG_DATA_CALLBACK = getattr(settings, 'OPENID_PROVIDER_SREG_DATA_CALLBACK',
                              'openid_provider.utils.get_default_sreg_data')