Skip to content

fix(git-auto-export): Start export only if GIT_URL exists in the course settings #495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/ol_openedx_git_auto_export/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ def async_export_to_git(course_key_string, user=None):
course_key = CourseKey.from_string(course_key_string)
course_module = modulestore().get_course(course_key)

if course_module.giturl is None:
LOGGER.debug(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should log this as info and not debug. These logs from the tasks do not show on the terminal when debug is used. Also, Debug will be false in live deployments. I do not know how you were able to see and verify these logs as you mentioned in the PR description.

"Course %s does not have a giturl, skipping export.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Course %s does not have a giturl, skipping export.",
"Course %s does not have a GIT URL set in course advanced settings, skipping auto export.",

course_module.id,
)
return

try:
LOGGER.debug(
"Starting async course content export to git (course id: %s)",
Expand Down
Loading