-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Added hostname argument to openended_post command. #2133
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,10 +27,11 @@ def is_secure(self): | |
| return False | ||
|
|
||
|
|
||
| def get_module_for_student(student, course, location): | ||
| def get_module_for_student(student, course, location, request=None): | ||
| """Return the module for the (student, location) using a DummyRequest.""" | ||
| request = DummyRequest() | ||
| request.user = student | ||
| if request is None: | ||
| request = DummyRequest() | ||
| request.user = student | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you need the conditional here, too?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, because there are other commands that use this function
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that don't pass in request as a param
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's not pretty, but again I just wanted to keep moving parts to a minimum for this hotfix |
||
|
|
||
| descriptor = modulestore().get_instance(course.id, location, depth=0) | ||
| field_data_cache = FieldDataCache([descriptor], course.id, student) | ||
|
|
||
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.
It would be cleaner to modify the DummyRequest class in utils.py but it is used for grading too. So to keep the changes isolated I have defined a new one. I can modify the other one too instead.
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 think this is fine for now, since it's more conservative.