Commit Graph

943 Commits

Author SHA1 Message Date
Justin Hynes
52f2231f20 fix: make the issued date displayed on previewed certificates match real certificates (#36471)
* fix: make the issued date displayed on previewed certificates match real certificates

This PR fixes an inconsistency in the dates displayed on certificates previewed via Studio with "real" certificates rendered to users.
2025-04-03 13:43:51 -04:00
sarina
1e3074a3f9 docs: Update edx.rtd.io links to docs.openedx.org 2025-04-02 12:10:56 -04:00
Justin Hynes
61879b8caf fix: ensure we are selecting the correct date for self-paced courses (#36465)
It is possible for self-paced courses to be configured with a display behavior of "END" even though this configuration option should be invalid. The fix to this problem is beyond the scope of this PR. However, we can ensure we are selecting the correct display date for the certificate with a little bit of defensive coding.

I've added a check to ensure that we only use the end date of the course when the course is instructor-paced and configured with a display behavior of "END".
2025-04-02 11:19:59 -04:00
Justin Hynes
f99b89c8c5 feat: update date selection logic when rendering course certs (#36447)
Fixes: https://github.com/openedx/platform-roadmap/issues/423

This PR updates the logic for determining the issued date shown on course certificates. For courses with a display behavior set to 'end date of the course', certificates earned by learners will now show the course run’s end date as the issued date.
2025-03-27 08:41:38 -04:00
Bryann Valderrama
f90e59e52a docs: add event_type inline code annotation for open edX events (#36355) 2025-03-14 09:55:50 +01:00
Deborah Kaplan
ecf5aee297 feat: management command to purge information about web certificates (#36287)
for Open edX  operators who still have users with legacy PDF certificates, retirement requires first extracting information from the user's GeneratedCertificate record in order to delete the 4 associated files for each PDF certificate, and then removing the links to the relevant files.  this creates a management command to do that work.

After thinking about it, I have removed the update to `status` from this management command, as per the original specification of the ticket. I added it for completeness originally, but was already uncomfortable, because it's not exactly accurate. The `CertificateStatuses` enum does define a `deleted` status:

```
    deleted             - The PDF certificate has been deleted.
```

but I think it's inappropriate to use here.

#### Why not use `CertificateStatuses.deleted` in the first place

There are multiple places in the code where it's clear that almost all of the statuses are legacy and unused (eg. [Example 1](6c6fd84e53/lms/djangoapps/certificates/data.py (L12-L34)), [Example 2](1029de5537/common/djangoapps/student/helpers.py (L491-L492))). There are innumerable APIs in the system that have expectations about what might possibly be returned from a `GeneratedCertificate.status` object, and none of them is expecting `deleted`

#### Why not revoke the certificate

Ultimately, the certificate isn't revoked, which has a specific meaning around saying it was unearned. The certificate was earned; it has simply been deleted.  We should not be kicking off program certificate invalidation, because that's not what's happening. We should be trusting the normal user retirement process to remove/purge PII from any program certificates that might exist. The nature of web certificates simply means that we are going through this process outside of the normal retirement flow. The normal retirement flow can be trusted to implement any certificate object revocation/removal/PII-purging, and doing an extra step outside of that flow is counterproductive.

#### Why not robustly add a flow for `CertificateStatuses.deleted`

When PDF certificates were removed from the system, they weren't removed in their entirety. Instead, we have this vestigial remains of PDF certificates code, just enough to allow learners to display and use the ones that they already have, without any of the support systems for modifying them. Adding a `deleted` status, verifying that all other APIs wouldn't break in the presence of a certificate with that status, adding the signals to process and propagate the change: all of this would be adding more tech debt upon the already existing technical debt which is the PDF certs code. Better to simply add this one necessary data integrity change, and focus on a process which might allow us to eventually remove the web certificates code.

#### Why it is good enough to ignore the status

The original ask was simply to enforce data integrity: to remove links to files that have been deleted, as an indication that they've been deleted. I only added `status` update out of a (misplaced but well-intentioned) completionist urge.

FIXES: APER-3889
2025-02-21 14:43:04 -05:00
Eemaan Amir
f722e3cd43 feat: add verify_uuid to response of CertificatesListView (#35760)
* feat: add verify_uuid to response of CertificatesListView

* test: updated tests
2024-11-18 12:00:01 +05:00
Zachary Hancock
c34ccffc7f feat: rework idv cert trigger (#35580)
* feat: rework idv cert trigger
* feat: separate PhotoVerification events
2024-10-04 12:58:15 -04:00
Deborah Kaplan
8c923bea24 feat!: removes deprecated v1 certificate behavior (#35562)
* feat!: removes deprecated v1 certificate behavior

this removes the long-deprecated v1  certificate behavior. This removes
the old-style date selection behavior  (ie., not a choice between
*Immediately upon passing*, *End date of course*, *A date after the course
end date*), which is no longer reliably maintained or supported in
Studio or Credentials.

FIXES: #35399
2024-10-02 12:06:57 -04:00
Zachary Hancock
0196def99d feat: use idv approved event (#35470)
* feat: replace LEARNER_NOW_VERIFIED signal with new openedx-event
2024-09-19 09:24:20 -04:00
Deborah Kaplan
58de0964ca feat: removing visible_date-to-creds updates per-cert (#35113)
* feat: removing visible_date-to-creds updates per-cert

The credentials IDA now relies on  the course certificate configuration
and (if present) `certificate_available_date` for displayability. We no
longer need to send `visible_date` updates for every awarded certificate
when a course  overview changes.
2024-07-17 08:43:12 -04:00
Deborah Kaplan
360159c642 feat: linting before touching all these files (#35108)
* feat:  linting before touching all these files

All these files are old enough, relative either to our current linting
rules or our current linter automation,  that modifying anything in them
either makes the linter cranky or wants to reformat  the entire file.
Rather than mixing cleanup with code changes, this commit just lints
this set of files to our current standards.
2024-07-10 14:29:53 -04:00
Deborah Kaplan
7124559906 feat: updating readmes for program/cert/creds apps (#35104)
The LMS `certificates` app `README`  has been, and the
openedx core `credentials` and `programs` READMEs  have been created.
This will clarify not only what the limited responsibilities
of each of these django apps is, but also the way they interact with
each other.

FIXES: APER-2929
2024-07-10 10:34:16 -04:00
Irtaza Akram
f7229e0aad chore: replace bleach with nh3 2024-05-28 13:02:16 +05:00
Justin Hynes
9fbc6e3bf4 feat: purge name from certificate records during user retirement (#34799)
[APER-3241]

This PR updates the retirement pipeline to purge learners' names from certificate records when their account is being retired.

It also introduces a new management command that can be used by Open edX operators to purge the leftover name data (PII data) from the `certificates_generatedcertificate` table. This is designed as a one-time use data fixup, as the retirement functionality should clean this moving forward.
2024-05-16 09:17:40 -04:00
Dmytro
9738f61519 fix: "Course org display str" option doesnt influence certificate (#34465)
"Course organization display string" option in Advanced settings doesn't influence certificate
Co-authored-by: Dima Alipov <dimaalipov@MacBook-Pro-Dima.local>
2024-04-23 09:21:32 -04:00
Feanil Patel
9bd4474f7d test: Reduce query counts now that we dropped django-splash. 2024-04-18 12:43:33 -04:00
Varsha Menon
0bf676c830 refactor: move rejected exam event handlers 2024-02-02 14:13:57 -05:00
Kaustav Banerjee
d0a49d1a01 fix: add missing function import in certificate template (#33904)
* fix: add missing function import in certificate template
* test: add test case to check certificates generated when GA4 is enabled
2024-01-31 09:18:34 +10:30
Deborah Kaplan
253853119f Merge branch 'master' into dkaplan1/APER-1322_certs-with-invalidation-records-arent-in-the-unavailable-status 2024-01-29 11:52:34 -05:00
Deborah Kaplan
1c049a3f39 feat: switching to a defined enum
feedback from code review

FIXES: APER-1322
2024-01-29 16:48:52 +00:00
Syed Sajjad Hussain Shah
cb2a34e51f feat: logout other sessions on email change (#33846)
* feat: logout other sessions on email change

* fix: updated the approach for session invalidation

* fix: update and add tests

* fix: update tests with descriptive comments

* feat: add integration tests

* fix: store email in session update

* fix: add setting for tests

* fix: fix tests

* feat: Upgrade Python dependency edx-drf-extensions (#34135)

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`

Co-authored-by: syedsajjadkazmii <syedsajjadkazmii@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: syedsajjadkazmii <syedsajjadkazmii@users.noreply.github.com>
2024-01-29 14:43:51 +05:00
Deborah Kaplan
f14d279dad feat: data migration for some ancient legacy problems
one time data migration for  certificates that ended up in a broken
state (not marked is unavailable, but having invalidation records).

FIXES: APER-1322
2024-01-25 22:13:02 +00:00
Deborah Kaplan
b4bf07660e feat: fixes from code review
improving a comment

FIXES: APER-2851
2024-01-18 15:14:24 +00:00
Deborah Kaplan
a35a6f908e feat: linter
Fixing a linter air

FIXES: APER-2851
2024-01-18 13:49:22 +00:00
Deborah Kaplan
e0ef013f02 feat: fixing some codestyle/lint errors
not sure why the manual linter didn't complain

FIXES: APER-2851
2024-01-17 22:00:30 +00:00
Deborah Kaplan
994b8a3d49 feat: adding tests to modify cert template
Re-factored to make the code more testable, and added some more tests,
also improved dry run logging

FIXES: APER-2851
2024-01-17 21:41:21 +00:00
Deborah Kaplan
cccb960f20 feat:tests for certificate template modifier
still needs mocks for all tests to work

FIXES: APER-2851
2024-01-16 23:07:51 +00:00
Deborah Kaplan
392110bdda feat: pep8 fixes
pep8

FIXES: APER-2851
2024-01-11 22:27:47 +00:00
Deborah Kaplan
3ac66de476 feat: adding migration
adding the migration for  the ability to manage these command configs
via django admin

FIXES: APER-2851
2024-01-11 22:17:19 +00:00
Deborah Kaplan
ce48516c90 feat: fixing a long line problem
fixing a long line problem

FIXES: APER-2851
2024-01-11 22:08:48 +00:00
Deborah Kaplan
18027adfae feat: reordering includes
undid my auto formatters reordering of the includes, because I'm
assuming that's what the lint-amnesty directives are there for. Best
practice would have a human-written comment explaining why they need to
stay there, but I'm just going have to assume it's correct, Because no
such human-written comment exists.

FIXES: APER-2851
2024-01-11 21:56:12 +00:00
Deborah Kaplan
9657645fad feat: adds a certificate template modifier
adds a management command to modify certificate templates, with a dry
run option. Inherently unsafe; just as a search and replace on the first
string match.

TODO:
* unit tests
* make sure the multi-line string replacements work via django admin

FIXES: APER-2851
2024-01-11 21:45:34 +00:00
Justin Hynes
49537d5011 docs: add diagrams for course cert awarding and revocation
[APER-2551]

This PR adds some diagrams to help visualize the current certificate awarding and revocation process of the monolith.
2024-01-03 18:58:35 +00:00
Varsha Menon
bfe6ba5daf fix: add import statement for handlers 2023-12-12 14:17:54 -05:00
Rebecca Graber
ddabba458b feat: remove manual sends of events (#33642) 2023-11-03 10:36:50 -04:00
thezaeemaanwar
0b3e4d73b6 feat!: Removed Badges App
fix: restored badges handlers

feat: remove FE code for badges

fix: resolved failing tests

fix: removed test case for badges app

fix: unused import error

fix: Response Field Count

fix: shareable account response length

fix: resolved PR comments

fix: revert settings override

feat!: Removed Badges App

fix: restored badges handlers

feat: remove FE code for badges

fix: resolved failing tests

fix: removed test case for badges app

fix: unused import error

fix: Response Field Count

fix: shareable account response length

fix: revert subscription badge
2023-10-18 20:30:04 +05:00
Rebecca Graber
80a25bc368 feat: use new event_bus_producer_config (#33458) 2023-10-16 14:07:10 -04:00
Isaac Lee
2ae07387b2 feat: receiver for invalidate certificate (#33319)
* feat: receiver for invalidate certificate

- consumes event of exam attempt rejected
- initial commit, need to make tests

* temp: moving consumer from signals to handlers.py

- Still need to make this work
- Need to make tests work too

* feat: refactored underlying code to api.py

- tests still need to be tweaked

* fix: commit history

* fix: improve api func name + add source param
2023-10-05 19:39:14 +00:00
Justin Hynes
f4c7f98034 fix: update toggle description to fix copy/paste issue 2023-09-22 17:20:00 +00:00
Justin Hynes
cc8722d1c0 feat: publish CERTIFICATE_REVOKED events to the event bus
This PR adds the ability for the LMS to publish `CERTIFICATE_REVOKED` events to the Event Bus. There is also work in progress for Credentials to consume these events.
2023-09-21 19:22:24 +00:00
Edward Zarecor
03f00d535e Merge branch 'master' into fix-FB-share 2023-09-07 16:09:14 -04:00
Awais Qureshi
4da29d914d chore: adding migrations related with django-history. (#32935) 2023-08-08 16:04:06 +05:00
Edward Zarecor
65f317de7e Merge branch 'master' into fix-FB-share 2023-06-09 10:33:48 -04:00
Justin Hynes
a631a05a26 fix: update name of topic used to publish CERTIFICATE_CREATED events
[APER-2347]

This PR updates the name of the topic we are publishing our `CERTIFICATE_CREATED` events to. We had put a very generic name when writing the publishing code (and this was way before the actual topic was created). Now that the Confluent configuration is ready we need to update the name in our publishing code.
2023-06-06 17:57:30 +00:00
Pooja Kulkarni
79f67b9ce3 refactor: rename descriptor -> block within lms/djangoapps/certificates
Co-authored-by: Agrendalath <piotr@surowiec.it>
2023-04-26 17:10:53 +02:00
Edward Zarecor
c0059c8247 Merge branch 'master' into fix-FB-share 2023-04-24 22:27:59 -04:00
Justin Hynes
2e68ca2377 feat: publish CERTIFICATE_CREATED events to the event bus
[APER-2344]

We would like to start consuming Certificate related events in Credentials from the event bus. This PR starts the process by publishing CERTIFICATE_CREATED events to the event bus. It also introduces a new feature flag (`SEND_CERTIFICATE_CREATED_SIGNAL`) to gate the functionality.
2023-04-19 19:53:35 +00:00
Diana Huang
c73e5ba518 docs: add CertificateModel ADR. (#31825)
Adds an ADR explaining that historical fields
used by CertificateModel were not removed.

Adds comments to point to ADR.
2023-02-24 10:06:00 -05:00
alipov-dm
681cc92b4b fix: share certificate in FB
Fixed the Course Card Image is absent on FB post after sharing by user.
2023-01-26 00:06:38 +02:00