-
Notifications
You must be signed in to change notification settings - Fork 3
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
refactor: move more functionality to Canvas plugin #387
Conversation
3563b20
to
4e4b32c
Compare
02a4875
to
4f4bf17
Compare
|
||
if course: | ||
return course.other_course_settings.get("canvas_id") | ||
return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if course: | |
return course.other_course_settings.get("canvas_id") | |
return None | |
return course.other_course_settings.get("canvas_id") if course else None |
**For "Quince" or more recent release of edX platform, you should cherry-pick below commit:** | ||
|
||
https://github.com/mitodl/edx-platform/commit/7a2edd5d29ead6845cb33d2001746207cf696383 | ||
|
||
**For "Nutmeg" or more recent release of edX platform, you should cherry-pick below commit:** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**For "Nutmeg" or more recent release of edX platform, you should cherry-pick below commit:** | |
**For "Nutmeg" release of edX platform, you should cherry-pick below commit:** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were in incremental order so a person reading from top to bottom would always go from Sumac to downward. When the go there they would see the next release and it's predecessors message. Eventually they will get the right version out of the list.
In any case, we can't specify one release name, it's always going to be a range. I went there and that made things more complex to read than using the same more recent format. If we still need to change, I'd go for a release range and not just one specific release.
The is for all the other comments on things like these below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I commented because Nutmeg and prior
means Nutmeg, Quince, and Sumac. These releases have specific commits/versions specified, so I think we can mention a single release in this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was that the person would read from top to bottom. So they will read Sumac message first. I'm changing it into a range in next commit anyway
|
||
TBA | ||
|
||
**For "Quince" or more recent release of edX platform, you should cherry-pick below commit:** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**For "Quince" or more recent release of edX platform, you should cherry-pick below commit:** | |
**For "Quince" release of edX platform, you should cherry-pick below commit:** |
|
||
Use ``0.3.0`` or a above version of this plugin | ||
|
||
|
||
**For "Nutmeg" or more recent release of edX platform** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**For "Nutmeg" or more recent release of edX platform** | |
**For "Nutmeg" release of edX platform** |
|
||
Use ``0.4.0`` or a above version of this plugin | ||
|
||
**For "Quince" or more recent release of edX platform** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**For "Quince" or more recent release of edX platform** | |
**For "Quince" release of edX platform** |
client = CanvasClient(canvas_course_id=course.canvas_course_id) | ||
if not course.canvas_course_id: | ||
canvas_course_id = get_canvas_course_id(course) | ||
client = CanvasClient(canvas_course_id=canvas_course_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are initializing client before checking canvas_course_id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Been there for a long time becasue and it didn't break because the canvas course Id check below that would return anyway, I'll move the client initialization a couple of lines below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I checked that. I just mentioned it because of the validation. We can either initialize it after the validation or remove the validation if it is not needed.
client = CanvasClient(canvas_course_id=course.canvas_course_id) | ||
if not course.canvas_course_id: | ||
canvas_course_id = get_canvas_course_id(course) | ||
client = CanvasClient(canvas_course_id=canvas_course_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, Initialization before validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
91dc185
to
34efad7
Compare
I've incorporated all the changes in 34efad7. @asadali145 Could you take a look? *Edit: I have added additional validations where applicable. |
canvas_course_id = get_canvas_course_id(course) | ||
if not course: | ||
raise Exception(COURSE_KEY_ID_EMPTY) # noqa: TRY002 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are validating course values after getting canvas id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in e028503
e028503
to
88f1500
Compare
What are the relevant tickets?
https://github.com/mitodl/hq/issues/5862
Description (What does it do?)
How can this be tested?