Extension point to customize certificate views - #21147
Conversation
|
Thanks for the pull request, @kaizoku! I've created OSPR-3752 to keep track of it in JIRA, where we prioritize reviews. Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
787e196 to
6bd84e6
Compare
|
@kaizoku Thank you for your contribution. Please let me know once tests are green and this is ready for our review. |
|
@natabene , I think that test failure was a fluke, it's an HTTP Connection error from selenium, and doesn't come from any components changed in this PR. The test works successfully on this branch in my devstack. I'll see if I can get jenkins to re-run it. |
|
jenkins run bokchoy |
There was a problem hiding this comment.
👍
- I tested this:
- Checked out this branch.
- Generated fake certificate for user.
- Checked that the certificate was publicly accessible ✔️
- Switched
certificates.require_loginon - Checked that the certificate page required login to be accessible, and the redirect pointed back to the correct page. ✔️
- I read through the code
- Includes documentation
⚠️ -
I checked for accessibility issuesNA
@kaizoku Nice work! Very simple and clean implementation. 😁
I have a question: isn't it better for this feature to be enabled/disabled per course instead of instance wide?
And a comment about your notes:
Should we create a waffle configuration in a new file for the certificates application?
This is not really required, but you could add a namespace variable to the top of the file where the switch is being used and use that, like this:
CERTIFICATES_NAMESPACE = 'certificates'
WaffleSwitch(CERTIFICATES_NAMESPACE, 'require_login').is_enabled()
There's not that many examples in the codebase related to that, and it's not a blocker for merging.
|
Thanks @giovannicimolin! Hm, perhaps we should use a My worry there is that course authors would have to create a new waffle flag for every course they create, and authentication wouldn't be enforced if they hadn't gotten the memo about creating waffle flags for their course. Whereas an organization who wants authentication for their certificates would likely want them for all courses, so missing this on one course would maybe be a kind of breach. Also for the documentation note, I'm not sure where waffle flags are typically documented. |
|
@giovannicimolin, I've switched this around to using a |
|
@kaizoku Nice work here! I tested it again and it works perfectly. 👍
|
|
@natabene This is ready for edX review. |
|
@ormsbee This is ready for your review, when you have a chance. |
|
@marcotuts Do you want to review this before it goes to engineering? |
|
@marcotuts, @ormsbee any chance you've been able to check this out? |
|
@kaizoku Sorry for delay, we will try to look at this this week. |
|
No problem @natabene , thanks for the response :) |
|
@natabene, any chance you've been able to look at this PR? |
|
@kaizoku Sorry, not yet. We will try today. |
|
@natabene has this come up for review yet? |
So can we close this OSPR? |
|
@pomegranited, we'll still need to add one line to enable the plugin point after https://github.com/edx/edx-platform/pull/21433 is merged. |
|
No worries, thanks for the update @kaizoku ! |
b2aca9e to
a8d295c
Compare
There was a problem hiding this comment.
@kaizoku, I see that the docstring, from which this has been copied, was not updated after the reworks. I'll fix this in #27466. Please use the prefix OVERRIDE_ for this, as described here (e.g. OVERRIDE_GET_UNIT_ICON), to keep it consistent.
There was a problem hiding this comment.
Thanks for pointing that out. I've updated the variable name here to match.
0e69769 to
d4b6ec6
Compare
|
This PR is ready for upstream review. |
bradenmacdonald
left a comment
There was a problem hiding this comment.
@kaizoku Code looks good to me 👍🏻
Can you please: (1) Update the PR description to match the final approach taken here, and (2) rebase+squash to one commit with a conventional commit prefix?
d39efcc to
43c332b
Compare
|
Thanks for the review @bradenmacdonald. I've squashed the PR, updated the commit message, and updated the PR description here. This should be ready now. |
|
jenkins run js |
|
Your PR has finished running tests. There were no failures. |
|
@kaizoku 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
|
Thanks for the review @bradenmacdonald ! |
We'd like to optionally require logins for viewing and downloading certificates.
This PR adds an extension point using a new feature added in openedx/edx-django-utils#64 to allow modifying the webview for certificates.
JIRA tickets: Implements BB-1388.
Dependencies: None
Sandbox URL: https://pr20957.sandbox.opencraft.hosting/
Testing instructions:
lms/envs/private.pyin the devstackAuthor notes and concerns: None
Reviewers