35 Commits

Author SHA1 Message Date
Juliana Kang
51d538cbe7 fix: Remove B2C Subscriptions (#35303)
REV-3697
2024-09-04 14:01:45 -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
ae3ce9c498 feat: fix exception handling in program cert revocation
To determine whether or not we need to  revoke any program certificates, we first run get_revokable_program_uuids. This calls get_certified_programs, which calls get_credentials, which uses the OpenEdx Core  utility method get_api_data. get_api_data makes the API call inside a try block, does raise_for_status  also inside the try block, and then catches the exception, logs it, and returns an empty result to the caller.

This means that on a failure to call the credentials API, get_credentials can’t  tell the difference between a failure to hit the API (because credentials is, as it sometimes is during a notify_programs run, overloaded), or a learner with no program certificates. In this particular case, this is absolute failure, incorrect behavior.

* Adds a new flag, `raise_on_error`  which will make `get_api_data` log the exception and then re-raise the HTTPError,  defaulting to false in order to avoid changing the behavior on any other callers
* Also: my editor reformatted all of the touched files to our modern code standards, and it seemed appropriate to let it do that.
* Also: added type hints in some cases, because they helped me write the code and debug. Our test suite definitely  reports mypy  results on type errors so we are verifying that hints are correct.

FIXES: APER-3146
2024-01-26 22:20:30 +00:00
Mohammad Ahtasham ul Hassan
df197837cb fix: remove extras and enhance existing subs logging (#32919) 2023-08-07 18:01:50 +05:00
Mohammad Ahtasham ul Hassan
06923c7948 feat: use username for course completion API instead of lms_user_id (#32761) 2023-07-17 20:17:12 +05:00
Mohammad Ahtasham ul Hassan
024096a589 temp: add temporary logging for entitlement revocation (#32746)
* temp: add temporary logging for entitlement revocation
2023-07-14 16:04:17 +05:00
Mohammad Ahtasham ul Hassan
00f049b9e9 fix: fix course completion utility (#32734) 2023-07-13 20:12:02 +05:00
Mohammad Ahtasham ul Hassan
7fe5229bbb feat: Add new entitlement expiration endpoint (#32677)
* feat: add new entitlements expiration endpoint
2023-07-13 13:38:20 +05:00
Mohammad Ahtasham ul Hassan
ee871730c8 feat: add course_status utility (#32545)
* feat: add course_status utility
2023-07-07 12:38:05 +05:00
Justin Hynes
e8679056e4 fix: remove learner record MFE URL building logic
[APER-2240]

The monolith no longer needs to understand how to build URLs to the Learner Record MFE. The Credentials IDA has logic to determine if (and how) a request should be redirected to the MFE so we can remove these  changes. Another PR later will remove the unused settings.
2023-01-31 07:57:26 -05:00
Justin Hynes
9e83bf8f94 feat: Add configuration option to route View Records button to the Learner Record MFE
[APER-1922]

We are converting the legacy UI of the `records` app in the Credentials IDA (credentials.edx.org/records/, credentials.edx.org/records/programs/{uuid}, etc.) to a new MFE. Today, the Program Dashboard and the legacy (non-MFE) profile page have buttons that route learners to the Credentials IDA pages. We need to (optionally) introduce a way to route learner's to the new MFE instead.

- Introduces a new configuration setting called `LEARNER_RECORD_MICROFRONTEND_URL` (defaulting to None). This will be used by the LMS to store the base URL of the new MFE (e.g. records.stage.edx.org).
- Introduces a new waffle switch named `USE_LEARNER_RECORD_MFE`. This will be used to control whether routing learner's to the new MFE is enabled from the LMS's side.
- Updates the existing `get_credentials_records_url` function to add additional logic that will determine if we need to build a link to the legacy FE or the new MFE
- Adds tests for new and existing behavior. There were no existing unit tests for the utility function that I updated.
2022-09-07 13:44:05 -04:00
Eugene Dyudyunov
289e682b8f FC-0001: Remove old EdxRestAPIClient usage across the platform (#30301)
* refactor: remove EdxRestAPIClient

* test: update tests according to EdxRestAPIClient removal

* fix: remove unused import
2022-05-09 12:48:26 -04:00
Thomas Tracy
6f44841deb [feat] Add user_id scope to credentialsApiClient (#28737)
Now that we're actively using the LMS_USER_ID inside credentials to
identify users, we need to make sure that users created by
notify_credentials are including it in the jwt scopes when authenticated
with credentials.
2021-09-15 09:17:51 -04:00
Usama Sadiq
7108562c87 refactor: ran pyupgrade on openedx/core/djangoapps/credentials (#26847) 2021-03-15 18:09:56 +05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
aarif
cdfee4348f ran python-modernize and isort on files mentioned in INCR-367
changes made to comply with pylint
2019-07-16 09:58:17 +00:00
Ned Batchelder
3353e7425e Remove unused imports 2018-11-03 16:07:05 -04:00
Nimisha Asthagiri
dc56a63e03 Remove deprecated JwtBuilder
ARCH-248
2018-10-17 07:43:59 -04:00
Diana Huang
755ebc8c7f Send program cert visible_date
When sending a program cert to Credentials, also send along a
calculated visible_date along with it.

LEARNER-6262
2018-09-04 16:05:24 -04:00
Dillon Dumesnil
ea48e7b885 Adding BI event for clicking to learn more about pathways + minor fixes on the page 2018-08-20 11:37:57 -04:00
Jeff LaJoie
b07374ed39 LEARNER-5050: Adds award course cert job to post to Credentials 2018-06-18 08:54:58 -04:00
Michael Terry
27a2b8f676 Only get program certs from credentials
Allow our utility function to filter out course certs when asking
Credentials for a list of certificates. This way once we start
handing back course certs, the LMS won't be surprised by
assumptions about what the credentials service will give back.
2018-06-01 12:53:18 -04:00
Waheed Ahmed
bc358b89de Add program UUID in cache key instead passing as resource id.
LEARNER-5373
2018-05-31 01:22:17 +05:00
Waheed Ahmed
e7963a5b40 Pass program UUID as resource_id to generate unique cache key.
Without program UUID cache key was same every time for single learner
on multiple programs and getting the same data from cache.

LEARNER-5373
2018-05-30 16:20:45 +05:00
Michael Terry
502287b07e Add some links to student records
Add some waffle-guarded connection points to the Credentials service
to start filling out the user flow for Student Records.

Specifically, add a button to the Program Progress Details page if
a certificate exists, and add a link in the Learner Profile page.

Both only appear if the 'student_records' waffle switch is active.

LEARNER-4701
2018-04-27 09:52:01 -04:00
Renzo Lucioni
2955a6e639 Remove credential listing from program list view
The new design for the program detail page introduced a sidebar which includes a program-specific listing of credentials. This is an improvement over the old list of credentials found on the program list page and is meant to replace it. The new detail page is stable, so the credential listing on the program list page can be removed.

LEARNER-492
2017-05-22 16:07:37 -04:00
Clinton Blackburn
ff4d9e4360 Using shared secret for JWTs sent to Credentials API
This change brings the Credentials API calls in line with those of other services. The change also makes it easier for the future switch to an asymmetric signing key.

LEARNER-629
2017-04-24 12:28:23 -04:00
Renzo Lucioni
f00059f28c Collect data needed for program progress sidebar
This includes a representation of the user's progress towards completing each course in the program and a list of any relevant course and/or program certificates the user has earned.

ECOM-7386
2017-04-05 19:06:28 -04:00
Renzo Lucioni
e7771148b7 Load all programs from the catalog
This commit contains back end changes necessary to load programs from the catalog in all contexts. The existing program munging utility is applied as late as possible to avoid conflating this work with changes to the front end; those will be made separately.

ECOM-4422
2017-02-06 23:16:29 -05:00
Matthew Piatetsky
05b461824e Pull programs from catalog when issuing program credentials
Lays the groundwork for pulling all program data from the catalog.

ECOM-6535
2017-01-20 14:48:43 -05:00
Renzo Lucioni
8196e1a024 Allow program listing page to display programs from any category
This work removes most references to XSeries from the LMS in an attempt to be more general. ECOM-5018.
2016-08-01 16:47:21 -04:00
Ahsan Ulhaq
a8f2de8375 Course Dashboard Visual Update
ECOM-4398
2016-05-24 16:17:19 +05:00
Ahsan Ulhaq
70eaf18936 caching for requests to credentials service
ECOM-3278
2016-01-28 13:05:50 +05:00
Ahsan Ulhaq
5181513629 Show message for earned programs credentials
ECOM-3015
2016-01-28 13:05:50 +05:00