Commit Graph

198 Commits

Author SHA1 Message Date
Juliana Kang
51d538cbe7 fix: Remove B2C Subscriptions (#35303)
REV-3697
2024-09-04 14:01:45 -04:00
salmannawaz
57b480b04f Update all edx-platform REST endpoints to support JWT Auth (#34152)
* chore: update API endpoints to support default JWT auth

The default DRF Auth classes were recently updated to allow for both JWT and Session auth by default. Any endpoint that overrides the AUTHENTICATION_CLASSES but has just session, just JWT or just both of those should be updated to remove the override.

Details in https://github.com/openedx/edx-platform/issues/33662
2024-02-13 10:46:58 -05:00
Diana Huang
282b934299 fix: Add code owner to celery task. (#33238)
Ensures that the code owner attribute is set
on celery task run for entitlements.
2023-09-13 12:01:58 -04:00
Usama Sadiq
9979017b69 fix: fix django4 deprecation warnings (#32975) 2023-08-16 16:20:54 +05:00
Awais Qureshi
4da29d914d chore: adding migrations related with django-history. (#32935) 2023-08-08 16:04:06 +05: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
1af9803cc0 fix: fix revocation utility comparison (#32751)
* fix: fix revocation utility comparison
2023-07-15 00:14:19 +05:00
Mohammad Ahtasham ul Hassan
34766474c0 fix: fix entitlement revocation task (#32750) 2023-07-14 20:12:59 +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
7fe5229bbb feat: Add new entitlement expiration endpoint (#32677)
* feat: add new entitlements expiration endpoint
2023-07-13 13:38:20 +05:00
Phillip Shiu
8072c3e9ef temp: fix entitlements_to_expire should be capped at entitlements_count (#32579) 2023-06-26 16:44:18 +00:00
Muhammad Zubair
2d0a8b44b7 feat: fixed failing checks related to linting and tests 2023-06-26 19:46:25 +05:00
Muhammad Zubair
3f84b14b92 feat: removed unnecessary ignore-liting message 2023-06-26 18:59:25 +05:00
Muhammad Zubair
4519ca405e chore: added standard logging and removed celery logging 2023-06-26 18:47:17 +05:00
Muhammad Zubair
87953991e0 feat: removed extra blank line 2023-06-26 15:40:09 +05:00
Phillip Shiu
e115cd9873 test: for entitlements tasks.expire_and_create_entitlements 2023-06-25 22:48:21 -04:00
Phillip Shiu
82338bd375 fix: SyntaxError: use CourseEntitlement.objects, not .object 2023-06-25 22:12:10 -04:00
Phillip Shiu
2af47c7128 temp: remove celery ignore_result=True
We are lacking information in Flower about our Celery tasks that are
marked as successful but are actually failing.

Attempt to remove ignore_result=True to see if this is suppressing
valuable debugging information.
2023-06-25 22:11:08 -04:00
Phillip Shiu
fb9bf9325e temp: fix use len(list) not list.count() in expire_and_create_entitlements (#32565) 2023-06-23 21:05:49 +00:00
Phillip Shiu
886227c88b temp: fix EncodeError for username in expire_and_create_entitlements (#32564)
On running the management command, we get the folowing error:

    kombu.exceptions.EncodeError: Object of type User is not JSON serializable

Pass a string of the username instead in the parameters of the tasks
created by the expire_and_create_entitlements management command.
2023-06-23 18:08:51 +00:00
Phillip Shiu
5996ae098b temp: fix EncodeError & correct EntitlementSupportDetail action name in expire_and_create_entitlements (#32562)
* fix: EntitlementSupportDetail.action is EXPIRE, not EXPIRED

* fix: pass list of entitlement ids, not QuerySet subset for Celery json parser

On running the management command, we get the folowing error:

    kombu.exceptions.EncodeError: Object of type CourseEntitlement is not JSON serializable

Pass a list of ints instead of a QuerySet object in the parameters of
the tasks created by the expire_and_create_entitlements management
command.
2023-06-23 14:31:12 +00:00
Phillip Shiu
5dfe83d154 chore: quality 2023-06-22 22:52:10 -04:00
Phillip Shiu
eee3db8820 perf: run select count(*) only once for entitlements.count()
Not much of an optimization, but might shave a couple seconds if the
number of entitlements on production are large.

Django will use the _result_cache if the QuerySet has already been
retrieved:

107865780a/django/db/models/query.py (L597-L598)
2023-06-22 22:42:49 -04:00
Phillip Shiu
d4ae7bfa06 fix: use newly created (not expired) entitlement id in logs and support records 2023-06-22 22:37:45 -04:00
Phillip Shiu
c973059ae7 feat: add start/end/length log information at beginning of each expire_and_create_entitlements task 2023-06-22 22:37:17 -04:00
Phillip Shiu
9dfa5563f5 feat: remove hardcodes of exceptional course uuids and username for support notes
The values of these may vary across our environments, so it may be
useful for testing to be able to set these from the management command
arguments.
2023-06-22 22:10:59 -04:00
Phillip Shiu
0ca47c7119 fix: use get_user_model() for E5102 imported-auth-user
Don't import django.contrib.auth.models.User model. Use
django.contrib.auth.get_user_model() instead.

36ea72b37c/pylint_django/checkers/auth_user.py (L18-L22)
2023-06-22 18:52:20 -04:00
Muhammad Zubair
43ea99e3a6 feat: skipped linting check 2023-06-22 18:52:20 -04:00
Muhammad Zubair
3e9038efcc feat: removed extra comma 2023-06-22 18:52:20 -04:00
Muhammad Zubair
ee968a1431 feat: fixed linting issues 2023-06-22 18:52:20 -04:00
Muhammad Zubair
825d161d1a feat: fixeid linting issues 2023-06-22 18:52:20 -04:00
Muhammad Zubair
1484750c8a feat: updated query to avoid enntitlements with with course run. 2023-06-22 18:52:20 -04:00
Muhammad Zubair
f674e35d1b feat: fixed linting issues 2023-06-22 18:52:20 -04:00
Muhammad Zubair
aefdc750a6 feat: incorporated feedback comments 2023-06-22 18:52:20 -04:00
Muhammad Zubair
3133628007 feat: incorporated feedback comments 2023-06-22 18:52:20 -04:00
Muhammad Zubair
a9afb4fb5b feat: added user in support_details object 2023-06-22 18:52:20 -04:00
Muhammad Zubair
a0d3c21295 feat: incorporated feedback comments 2023-06-22 18:52:20 -04:00
Muhammad Zubair
8e2612358d feat: resolved linting issues 2023-06-22 18:52:20 -04:00
Muhammad Zubair
33bc48b8de feat: resolved linting issues 2023-06-22 18:52:20 -04:00
Muhammad Zubair
2887e8967e feat: resolved linting issues 2023-06-22 18:52:20 -04:00
Muhammad Zubair
b88a34d3f5 feat: update logic and modified code 2023-06-22 18:52:20 -04:00
Muhammad Zubair
4d4f1cd1b5 chore: added a django management command to expire old entitlements and create new one against them 2023-06-22 18:52:20 -04:00
Awais Qureshi
2a1cf5f0d0 chore: upgrading djangorestframework. (#32487)
* chore: upgrading djangorestframework.
2023-06-20 16:03:34 +05:00
Mohammad Ahtasham ul Hassan
4048bf9fb4 feat: fix throttling for subscription service user (#32473)
* feat: add subscriptions_worker to ent access list

* fix: add throttle for entitlement APIS
2023-06-20 14:58:35 +05:00
Chris Pappas
38a69d10ff feat: allow course entitlements REST API to be filtered on course_uuid (#32305)
* feat: allow course entitlements REST API to be filtered on course_uuid

* feat: add field to filter out entitlements with null expired_at values

* chore: update tests
2023-05-26 09:44:32 -04:00
Ned Batchelder
12765a7a59 refactor(test): use @skip_unless_lms uniformly 2023-02-01 13:52:26 -08:00
Jawayria
7f5b4a6a47 chore: removed 'wrong-import-order' from disabled imports (#29365)
* chore: removed 'wrong-import-order' from disabled imports
2022-01-06 19:14:51 +05:00
Jawayria
833ce7d586 Merge pull request #29570 from edx/jawayria/fix-url-common
fix: fixed RemovedInDjango40 warnings in common
2021-12-15 13:55:37 +05:00
Jawayria
bd5e00b725 fix: fixed RemovedInDjango40 warnings in common 2021-12-14 19:55:01 +05:00