-
Notifications
You must be signed in to change notification settings - Fork 4.2k
TNL-5721 – Fix check source module access before appending it to required modules #13868
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
Conversation
| if module: | ||
| result.append(module) | ||
|
|
||
| return result |
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.
what is result is empty?
|
@Qubad786 can you give steps to create such a conditional module in a course? I'd like to be able to test this locally |
| <p class="conditional-message">${_message(reqm, message)}</p> | ||
| % else: | ||
| <p class="conditional-message"> | ||
| You do not have access to this dependency module. Please ask course staff to grant the access. |
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.
string should be i18n'd. Also, I'd lose the second sentence. Just do "You do not have access to this dependency module."
438f444 to
4b67cb3
Compare
|
@adampalay , I wasn't able to create conditional module from the instructions in https://github.com/edx/edx-platform/pull/11710. I've imported on local. There are plently of conditionals in that course. I could build sandbox and setup a course for testing but http://jenkins.edx.org:8080/view/Ansible/job/ansible-provision/build?delay=0sec does not seem to be working for me. I am filing an IT support ticket. |
|
@Qubad786 Sandbox link is now working. If it's not working for you, I'd like to make a sandbox for your branch. |
|
@attiyaIshaque still no luck for me, it'd be great if you can build one for this branch. |
| # So just log and return false. | ||
| log.warn('Error in conditional module: \ | ||
| required module {module} has no {module_attr}'.format(module=module, module_attr=attr_name)) | ||
| if module is not 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.
why could a module be None here?
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.
get_module has been used in required_modules which may return None if requester does not have access to that module – see more.
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.
can you just include a comment to that effect?
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.
Fair enough, will do that.
|
@Qubad786 Sandbox is ready. |
|
jenkins run js |
|
Thanks for the sandbox @attiyaIshaque. |
|
@adampalay, @attiyaIshaque just set up a conditional course, courseware link on the ticket. |
cc8652b to
c7d2ce4
Compare
|
@Qubad786 Code looks perfect to me. I have also tested on the sandbox. |
c7d2ce4 to
3bd4698
Compare
|
jenkins run bokchoy |
|
jenkins run lettuce |
adampalay
left a comment
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.
Minor comment, otherwise 👍
0fff215 to
c7364a0
Compare
|
Yay! |
TNL-5721
Description
Conditional modules with staff only required module(s), when accessed as student, caused uncatched exception while rendering it in mako template. Now, we are checking for the
required_modulebefore using the data from it in string interpolation.Sandbox
Testing
Screenshot
Conditional with three required modules with one of them having staff access.
Reviewers
If you've been tagged for review, please check your corresponding box once you've given the 👍.
Post-review