Fixed wrong check for cache path
authorFrederic Massart <fred@moodle.com>
Tue, 4 Dec 2012 09:50:32 +0000 (17:50 +0800)
committerFrederic Massart <fred@moodle.com>
Wed, 5 Dec 2012 06:15:09 +0000 (14:15 +0800)
lib/workplace.py

index 585942e..94677fa 100644 (file)
@@ -42,14 +42,14 @@ class Workplace(object):
         if dataDir == None:
             dataDir = C.get('dataDir')
 
-        if not os.path.isdir(path):
-            raise Exception('Directory %s not found' % path)
-
         # Directory paths
         self.path = os.path.abspath(os.path.realpath(os.path.expanduser(path)))
         self.cache = os.path.abspath(os.path.realpath(os.path.expanduser(C.get('dirs.mdk'))))
         self.www = os.path.abspath(os.path.realpath(os.path.expanduser(C.get('dirs.www'))))
 
+        if not os.path.isdir(self.path):
+            raise Exception('Directory %s not found' % self.path)
+
         # Directory names
         self.wwwDir = wwwDir
         self.dataDir = dataDir