-
Notifications
You must be signed in to change notification settings - Fork 14
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
Use DB configured canvas assignments in launches #3127
Conversation
702f42b
to
a2e93ea
Compare
057dae5
to
48a4c00
Compare
39f14dc
to
d6b01f8
Compare
a2e93ea
to
a7a096a
Compare
d6b01f8
to
d1f91f9
Compare
a7a096a
to
ff32a99
Compare
d1f91f9
to
196834c
Compare
ff32a99
to
d442cb8
Compare
196834c
to
d46b786
Compare
d442cb8
to
cba0950
Compare
0752227
to
667b97b
Compare
932e114
to
2d38f0f
Compare
667b97b
to
a0612b0
Compare
a0612b0
to
ad3e4c1
Compare
2d38f0f
to
e6dc269
Compare
ad3e4c1
to
aa07875
Compare
c97d799
to
90b224e
Compare
e73b33e
to
70794ef
Compare
tool_consumer_instance_guid = request.params.get("tool_consumer_instance_guid") | ||
|
||
return ( | ||
assignment_svc.exists(tool_consumer_instance_guid, resource_link_id) | ||
assignment_svc.exists( |
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.
This will find assignments created by the new API (once the FE part is merged) but not yet launched
name = "canvas_file" | ||
|
||
def __call__(self, context, request): | ||
return ("canvas_file" in request.params) == self.value | ||
return ("canvas_file" in request.params) == self.value and self.db_configured( |
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.
Exclude db_configured ones
def __call__(self, context, request): | ||
return ("url" in request.params) == self.value | ||
return ("url" in request.params) == self.value and self.db_configured( |
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.
Exclude db_configured ones
@@ -93,16 +93,18 @@ def store_lti_data(self): | |||
@view_config(canvas_file=True) | |||
def canvas_file_basic_lti_launch(self): | |||
""" | |||
Respond to a Canvas file assignment launch. | |||
Respond to a Canvas file assignment launch which is not db_configured. |
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.
Should we rename this view to legacy_canvas_file_basic_lti_launch()
?
lms/views/basic_lti_launch.py
Outdated
# | ||
# We need to merge the two assignments into one. | ||
|
||
# order is guaranteed by the query's `order by` |
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.
# order is guaranteed by the query's `order by` |
I think we should remove the comment as it's unclear that the query refers to (since it refers to a SQLAlchemy query in another file). It's part of get_for_canvas_launch()
's contract/docstring that if it returns two assignments it'll be the old one first:
lms/lms/services/assignment.py
Line 74 in a6b7e55
The assignment with the resource_link_id will always be first in the sequence. |
70794ef
to
c0cdab2
Compare
Without #3126 this PR should still show not behavior changes.
The new
canvas_db_configured_basic_lti_launch
will handle newly configured assigments, existing ones and the ones that need merging.Note that in this PR (pending the merging of the fronted part) canvas assignment are both url and db configured, that's why we needed to explicitly exclude db_configured ones from the url_conifgured predicate.
The rationale here is to merge this, start storing all assignment in the DB and later stop sending canvas the URL, file id, group set... and have a legacy_canvas_assignment (with params from the URL) and switch the
canvas_db_configured_basic_lti_launch
to pick the params from the DB.