]> git.openstreetmap.org Git - osqa.git/blobdiff - forum_modules/sximporter/views.py
Merge of jambazov branch to trunk. Adds CC license and failed sign-in referrer bug...
[osqa.git] / forum_modules / sximporter / views.py
index 95e6826ca497ba43dc93b4a6378b8d524500a5af..dcca241c3a49b081172a4a07904f1fc1326a2c81 100644 (file)
@@ -13,6 +13,9 @@ def sximporter(request):
         members = [f for f in dump.namelist() if f.endswith('.xml')]\r
         extract_to = os.path.join(os.path.dirname(__file__), 'tmp')\r
 \r
+        if not os.path.exists(extract_to):\r
+            os.makedirs(extract_to)\r
+\r
         for m in members:\r
             f = open(os.path.join(extract_to, m), 'w')\r
             f.write(dump.read(m))\r
@@ -24,4 +27,4 @@ def sximporter(request):
 \r
     return render_to_response('modules/sximporter/page.html', {\r
     'names': list\r
-    }, context_instance=RequestContext(request))
\ No newline at end of file
+    }, context_instance=RequestContext(request))\r