ol-openedx-git-auto-export 0.7.0__tar.gz → 0.7.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/PKG-INFO +1 -1
  2. ol_openedx_git_auto_export-0.7.1/ol_openedx_git_auto_export/settings/common.py +22 -0
  3. ol_openedx_git_auto_export-0.7.1/ol_openedx_git_auto_export/settings/production.py +22 -0
  4. {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/tasks.py +3 -1
  5. {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/pyproject.toml +1 -1
  6. ol_openedx_git_auto_export-0.7.0/ol_openedx_git_auto_export/settings/common.py +0 -15
  7. ol_openedx_git_auto_export-0.7.0/ol_openedx_git_auto_export/settings/production.py +0 -15
  8. {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/.gitignore +0 -0
  9. {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/LICENSE +0 -0
  10. {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/README.rst +0 -0
  11. {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/__init__.py +0 -0
  12. {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/admin.py +0 -0
  13. {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/app.py +0 -0
  14. {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/constants.py +0 -0
  15. {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/management/commands/__init__.py +0 -0
  16. {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/management/commands/migrate_giturl.py +0 -0
  17. {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/migrations/0001_initial.py +0 -0
  18. {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/migrations/__init__.py +0 -0
  19. {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/models.py +0 -0
  20. {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/settings/__init__.py +0 -0
  21. {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/signals.py +0 -0
  22. {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ol-openedx-git-auto-export
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Summary: A plugin that auto saves the course OLX to git when an author publishes it
5
5
  Author: MIT Office of Digital Learning
6
6
  License-Expression: BSD-3-Clause
@@ -0,0 +1,22 @@
1
+ """Common settings unique to the git auto export plugin."""
2
+
3
+ from ol_openedx_git_auto_export.constants import (
4
+ ENABLE_AUTO_GITHUB_REPO_CREATION,
5
+ ENABLE_GIT_AUTO_EXPORT,
6
+ )
7
+
8
+
9
+ def plugin_settings(settings):
10
+ """Settings for the git auto export plugin.""" # noqa: D401
11
+ env_tokens = getattr(settings, "ENV_TOKENS", {})
12
+ settings.GIT_REPO_EXPORT_DIR = env_tokens.get(
13
+ "GIT_REPO_EXPORT_DIR", "/openedx/export_course_repos"
14
+ )
15
+ settings.GITHUB_ORG_API_URL = env_tokens.get("GITHUB_ORG_API_URL", "")
16
+ settings.GITHUB_ACCESS_TOKEN = env_tokens.get("GITHUB_ACCESS_TOKEN")
17
+ settings.FEATURES[ENABLE_GIT_AUTO_EXPORT] = env_tokens.get("FEATURES", {}).get(
18
+ ENABLE_GIT_AUTO_EXPORT, True
19
+ )
20
+ settings.FEATURES[ENABLE_AUTO_GITHUB_REPO_CREATION] = env_tokens.get(
21
+ "FEATURES", {}
22
+ ).get(ENABLE_AUTO_GITHUB_REPO_CREATION, False)
@@ -0,0 +1,22 @@
1
+ """Production settings unique to the git auto export plugin."""
2
+
3
+ from ol_openedx_git_auto_export.constants import (
4
+ ENABLE_AUTO_GITHUB_REPO_CREATION,
5
+ ENABLE_GIT_AUTO_EXPORT,
6
+ )
7
+
8
+
9
+ def plugin_settings(settings):
10
+ """Settings for the git auto export plugin.""" # noqa: D401
11
+ env_tokens = getattr(settings, "ENV_TOKENS", {})
12
+ settings.GIT_REPO_EXPORT_DIR = env_tokens.get(
13
+ "GIT_REPO_EXPORT_DIR", "/openedx/export_course_repos"
14
+ )
15
+ settings.GITHUB_ORG_API_URL = env_tokens.get("GITHUB_ORG_API_URL", "")
16
+ settings.GITHUB_ACCESS_TOKEN = env_tokens.get("GITHUB_ACCESS_TOKEN")
17
+ settings.FEATURES[ENABLE_GIT_AUTO_EXPORT] = env_tokens.get("FEATURES", {}).get(
18
+ ENABLE_GIT_AUTO_EXPORT, True
19
+ )
20
+ settings.FEATURES[ENABLE_AUTO_GITHUB_REPO_CREATION] = env_tokens.get(
21
+ "FEATURES", {}
22
+ ).get(ENABLE_AUTO_GITHUB_REPO_CREATION, False)
@@ -18,6 +18,7 @@ from ol_openedx_git_auto_export.models import CourseGitRepository
18
18
  from ol_openedx_git_auto_export.utils import (
19
19
  export_course_to_git,
20
20
  github_repo_name_format,
21
+ is_auto_repo_creation_enabled,
21
22
  )
22
23
 
23
24
  LOGGER = get_task_logger(__name__)
@@ -55,7 +56,8 @@ def async_export_to_git(course_key_string, user=None):
55
56
  "Creating repository and exporting course content.",
56
57
  course_key_string,
57
58
  )
58
- async_create_github_repo.delay(str(course_key), export_course=True)
59
+ if is_auto_repo_creation_enabled():
60
+ async_create_github_repo.delay(str(course_key), export_course=True)
59
61
  except Exception:
60
62
  LOGGER.exception(
61
63
  "Unknown error occured during async course content export to git (course id: %s)", # noqa: E501
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ol-openedx-git-auto-export"
3
- version = "0.7.0"
3
+ version = "0.7.1"
4
4
  description = "A plugin that auto saves the course OLX to git when an author publishes it"
5
5
  authors = [
6
6
  {name = "MIT Office of Digital Learning"}
@@ -1,15 +0,0 @@
1
- """Common settings unique to the git auto export plugin."""
2
-
3
- from ol_openedx_git_auto_export.constants import (
4
- ENABLE_AUTO_GITHUB_REPO_CREATION,
5
- ENABLE_GIT_AUTO_EXPORT,
6
- )
7
-
8
-
9
- def plugin_settings(settings):
10
- """Settings for the git auto export plugin.""" # noqa: D401
11
- settings.GIT_REPO_EXPORT_DIR = "/openedx/export_course_repos"
12
- settings.GITHUB_ORG_API_URL = "https://github.mit.edu/api/v3/orgs/mitodl"
13
- settings.GITHUB_ACCESS_TOKEN = "token" # noqa: S105
14
- settings.FEATURES[ENABLE_GIT_AUTO_EXPORT] = True
15
- settings.FEATURES[ENABLE_AUTO_GITHUB_REPO_CREATION] = False
@@ -1,15 +0,0 @@
1
- """Production settings unique to the git auto export plugin."""
2
-
3
- from ol_openedx_git_auto_export.constants import (
4
- ENABLE_AUTO_GITHUB_REPO_CREATION,
5
- ENABLE_GIT_AUTO_EXPORT,
6
- )
7
-
8
-
9
- def plugin_settings(settings):
10
- """Settings for the git auto export plugin.""" # noqa: D401
11
- settings.GIT_REPO_EXPORT_DIR = "/openedx/export_course_repos"
12
- settings.GITHUB_ORG_API_URL = "https://github.mit.edu/api/v3/orgs/mitodl"
13
- settings.GITHUB_ACCESS_TOKEN = "token" # noqa: S105
14
- settings.FEATURES[ENABLE_GIT_AUTO_EXPORT] = True
15
- settings.FEATURES[ENABLE_AUTO_GITHUB_REPO_CREATION] = False