From c63d153c4ef903bc948d3055a65b5a2604c448d8 Mon Sep 17 00:00:00 2001
From: Tobias Macey <tmacey@mit.edu>
Date: Mon, 10 Dec 2018 14:17:55 -0500
Subject: [PATCH] Fix inconsistency in assumed data dir for course import

With the expanded idea of what `settings.DATA_DIR` pertains to, there is an inconsistency in the assumed location of course repositories that can lead to failed impots. In `import_olx` the root is set to be `settings.GITHUB_REPO_ROOT`, whereas in the `extract_tar.py` file it is validating against `settings.DATA_DIR` which can no longer be assumed to be the same location. This PR brings those two assumptions in line to rely on the `settings.GITHUB_REPO_ROOT` in both locations.
---
 openedx/core/lib/extract_tar.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/openedx/core/lib/extract_tar.py b/openedx/core/lib/extract_tar.py
index 37c5e4be71c..99c7a9f0ecd 100644
--- a/openedx/core/lib/extract_tar.py
+++ b/openedx/core/lib/extract_tar.py
@@ -45,8 +45,8 @@ def safemembers(members, base):
 
     base = resolved(base)
 
-    # check that we're not trying to import outside of the data_dir
-    if not base.startswith(resolved(settings.DATA_DIR)):
+    # check that we're not trying to import outside of the github_repo_root
+    if not base.startswith(resolved(settings.GITHUB_REPO_ROOT)):
         raise SuspiciousOperation("Attempted to import course outside of data dir")
 
     for finfo in members:
-- 
GitLab