Commit Graph

16 Commits

Author SHA1 Message Date
Bianca Severino
76f9756f92 feat: only enable verified name feature if Name Affirmation is installed 2022-02-18 13:25:30 -05:00
Jawayria
826fc33274 chore: Applied lint-amnesty on lms/djangoapps/{certificates, course_goals} 2021-12-17 16:16:51 +05:00
michaelroytman
bb299c9521 feat: Remove Use of VERIFIED_NAME_FLAG Waffle Flag and is_verified_enabled Utility
The VERIFIED_NAME_FLAG, the VerifiedNameEnabledView, and the verified_name_enabled key removed from responses for both VerifiedNameView view and VerifiedNameHistoryView
were removed as part https://github.com/edx/edx-name-affirmation/pull/12. This was released in version 2.0.0 of the edx-name-affirmation PyPI package. Please see below for additional context for the removal, copied from the name-affirmation commit message.

The VERIFIED_NAME_FLAG was added as part https://github.com/edx/edx-name-affirmation/pull/12, [MST-801](https://openedx.atlassian.net/browse/MST-801) in order to control the release of the Verified Name project. It was used for a phased roll out by percentage of users.

The release reached a percentage of 50% before it was observed that, due to the way percentage roll out works in django-waffle, the code to create or update VerifiedName records was not working properly. The code was written such that any change to a SoftwareSecurePhotoVerification model instance sent a signal, which was received and handled by the Name Affirmation application. If the VERIFIED_NAME_FLAG was on for the requesting user, a Celery task was launched from the Name Affirmation application to perform the creation of or update to the appropriate VerifiedName model instances based on the verify_student application signal. However, we observed that when SoftwareSecurePhotoVerification records were moved into the "created" or "ready" status, a Celery task in Name Affirmation was created, but when SoftwareSecurePhotoVerification records were moved into the "submitted" status, the corresponding Celery task in Name Affirmation was not created. This caused VerifiedName records to stay in the "pending" state.

The django-waffle waffle flag used by the edx-toggle library implements percentage rollout by setting a cookie in a learner's browser session to assign them to the enabled or disabled group.
It turns out that the code that submits a SoftwareSecurePhotoVerification record, which moves it into the "submitted" state, happens as part of a Celery task in the verify_student application in the edx-platform. Therefore, we believe that because there is no request object in a Celery task, the edx-toggle code is defaulting to the case where there is no request object. In this case, the code checks whether the flag is enabled for everyone when determining whether the flag is enabled. Because of the percentage rollout (i.e. waffle flag not enabled for everyone), the Celery task in Name Affirmation is not created. This behavior was confirmed by logging added as part of https://github.com/edx/edx-name-affirmation/pull/62.

We have determined that we do not need the waffle flag, as we are comfortable that enabling the waffle flag for everyone will fix the issue and are comfortable releasing the feature to all users. For this reason, we are removing references to the flag.

[MST-1130](https://openedx.atlassian.net/browse/MST-1130)
2021-11-01 13:33:55 -04:00
Bianca Severino
d2fa7f7239 feat: use verified name for certs if enabled
If the verified name feature is enabled and the user has their
preference set to use verified name for certificates, create and
display certificates with their verified name rather than their
profile name.
2021-08-06 14:28:06 -04:00
Matt Tuchfarber
622d56026c Certificate Display Settings revamp (round 2) (#28286)
feat: reimagine certificate display settings

The course settings `certificate_available_date` (CAD) and
`certificates_display_behavior` (CDB) were previously
acting indedependantly of one another. They now work in
tandem. This change:
- limits CDB to a dropdown
- removes "early_with_info" and adds "end_with_date"
- only takes CAD into account if "end_with_date" is selected
- Moves CDB to the main course schedule settings page
- updates CourseOverview model and CourseDetails objects to
validate these fields and choose sane defaults if they aren't
expected values

This work was previously done in bd9e7dd (complete with bugs), so this
version is toggleable via the ENABLE_V2_CERT_DISPLAY_SETTINGS setting
2021-08-02 11:30:15 -04:00
Matt Tuchfarber
d16c9a804c refactor: Move cert code to cert app
The `may_certify` function is used to determine whether a learner should
be able to see that their certificate is ready. It is therefore entirely
in the certificates domain. This remove may_certifiy and
may_certify_for_course from the xmodule and course_overview
apps and into the certificates app. The xmodule may_certify was not called
outside of tests prior to this, and the other's were easily moved.

In order to avoid circular imports, this also moved
certificate_info_for_user out of the model code and into an API
2021-07-21 15:56:19 -04:00
Justin Hynes
725793a8f9 refactor!: remove get_course_overview function in favor of get_course_overview_or_none
[MICROBA-1289]
* Remove `get_course_overview` function in favor of `get_course_overview_or_none`
2021-07-09 10:14:07 -04:00
Justin Hynes
c1f7272174 feat!: Remove certificate generation segment event
[MICROBA-1298]
* Remove a Segment certificate event that was, historically, only emit from the courseware.

The Segment event that was previously (only) issued in the courseware doesn't seem to be important or referenced anywhere we could see. Since this event only tracked certificate generation attempts from one (of multiple) paths to initiate certificate generation in v1, I didn't think the historical event data captured is complete. We approached our data teams and I determined this event was not of high importance. For this reason, I am suggesting we just stop using this event and remove the code responsible for sending it.

We will continue to track certificate creation/generation using the existing `edx.certificate.created` event.
2021-06-30 09:23:46 -04:00
Christie Rice
2a9b1a495e fix: Emit a segment event after passing certificate generation in V2 of course certificates (#27965)
MICROBA-1082
2021-06-15 15:51:05 -04:00
Justin Hynes
855cf11dd1 docs: update event info in comments of the emit_certificate_event function
[MICROBA-1075]
- update event info in comments of the `emit_certificate_event` function
2021-06-01 13:11:30 -04:00
Justin Hynes
dd06820cad refactor: consolidate duplicate utility functions in certificates app
[MICROBA-1208]
* consolidate `has_html_certificates_enabled` and `has_html_certificates_enabled_from_course_overview`, the latter of the two functions was created for use during our transition away from using the modulestore in the certificate app.
2021-05-13 07:52:02 -04:00
Justin Hynes
80833406c7 refactor: remove use of modulestore in certificates app
[MICROBA-1178]

* remove use of modulestore in `utils.py` of the certificates django app
2021-05-07 15:30:03 -04:00
Justin Hynes
5db4fd5bb2 refactor: reduce certificate django apps dependence on the modulestore (generation_handler)
[MICROBA-1178]
- remove modulestore usage in `generation_handler.py`
- add duplicate functions that utilize a CourseKey or CourseOverview to remove dependence on modulestore (this will be cleaned up (if possible) at a later part of this refactor)
- add python API function to `content`/`course_overview` app that will retrieve a single CourseOverview (rather than a serialized list of dicts of CourseOverview data)
2021-05-04 07:47:58 -04:00
usamasadiq
84bb9faa3f refactor: ran pyupgrade on lms/djangoapps/certificates 2021-02-25 19:58:39 +05:00
Christie Rice
3638005326 MICROBA-921 Add certificate allowlist (#26129) 2021-01-29 10:22:07 -05:00
Christie Rice
b1e5695acf MICROBA-921 Move emit_certificate_event() to utils (#26133) 2021-01-26 14:41:34 -05:00