Commit Graph

19868 Commits

Author SHA1 Message Date
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
Jenkins
fa93f5c3a2 chore: geoip2: update maxmind geolite country database 2023-06-21 16:58:57 -04:00
Agrendalath
71fee4a4a0 feat!: remove block handling from runtime initialization of ReplaceURLService
BREAKING CHANGE: This removes the following deprecated shims from the runtime:
`replace_urls`, `replace_course_urls`, `replace_jump_to_id_urls`. XBlocks need
to use the `replace_urls` service instead.
2023-06-21 20:28:24 +02:00
Moeez Zahid
9a8f08f972 fix: Handle invalid_client error for Apple migration (#32531) 2023-06-21 14:20:39 +05: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
Moeez Zahid
2d1a6e27fc refactor: Add exception handling to Apple migration commands (#32500)
* refactor: Add exception handling to Apple migration commands

* refactor: Remove extra import
2023-06-19 14:07:24 +05:00
Jesper Hodge
a6c57811cd feat add xblock api endpoint (#32282)
* feat: add xblock endpoint for updating an xblock

fix: remove debugger

feat: make function call more generic

refactor: just use request.json for request data as before

refactor: extract method

fix: revert wrong method change

fix: refactor correct method

feat: use handle_xblock method so that we can do more than update xblocks

fix: usage_key_string defaults to None

add all CRUD operations

fix usage key parameter

refactor: create /views folder

refactor: move xblock view functions to xblock_services

fix: tests

fix: tests

refactor: move xblock API endpoint to contentstore

* docs: add explanatory comment to new xblock_service

* feat: add feature flag for enabling content editing api

* feat: raise 404 if studio content api is disabled

* tests: test xblock endpoint

* test: make all post tests work

* test: check that xblock_handler receives correct args

* refactor: create util mixin for course factories with staff

* refactor: extract course staff authorization tests

* refactor: extract tests to api view testcase class

* test: add get tests

* test: fix tests

* test: fix tests

* test: fix tests

* test: add all crud tests

* fix: refactor to fix tests

* fix: merge conflict

* fix: merge conflict

* fix: tests after merge

* fix: json request decorator

* fix: lint

* fix: lint

* fix: lint

* fix: lint

* fix: new test files

* fix: lint

* fix: lint and apply PR suggestions

* fix: lint

* fix: lint

* fix: lint

* fix: lint

* fix: lint

* fix: lint
2023-06-15 14:17:49 -04:00
Agrendalath
9fbc263edd feat: remove block-specific handling from runtime role checks 2023-06-15 11:08:03 +02:00
Jenkins
7b22a7c322 chore: geoip2: update maxmind geolite country database 2023-06-14 16:58:51 -04:00
Jenkins
5c961b7b04 chore: geoip2: update maxmind geolite country database 2023-06-07 16:58:55 -04:00
Moeez Zahid
6ab9e497fc refactor: Add logging, exception handling to Apple migration commands (#32390)
* refactor: Add logging, exception handling to Apple migration commands
* refactor: pylint fixes
2023-06-07 17:07:13 +05:00
Jenkins
aace5813b3 chore: geoip2: update maxmind geolite country database 2023-05-31 16:58:47 -04: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
Jenkins
16955828e7 chore: geoip2: update maxmind geolite country database 2023-05-24 16:58:47 -04:00
Zainab Amir
fa7953ca24 feat: set traverse pagination to False (#32269)
* For enrollment email task, while getting course uuid and
owner data don't traverse the discovery endpoint.
* Update log message
2023-05-19 19:46:33 +05:00
John Nagro
0fd36f97f3 fix: adding some logging and exceptions to further investigation into discovery load (#32267) 2023-05-18 19:42:19 -04:00
Syed Ali Abbas Zaidi
d7053a6783 fix: eslint autofixable issues (#32181)
* fix: eslint operator-linebreak issue

* fix: eslint quotes issue

* fix: react jsx indent and props issues

* fix: eslint trailing spaces issues

* fix: eslint line around directives issue

* fix: eslint semi rule

* fix: eslint newline per chain rule

* fix: eslint space infix ops rule

* fix: eslint space-in-parens issue

* fix: eslint space before function paren issue

* fix: eslint space before blocks issue

* fix: eslint arrow body style issue

* fix: eslint dot-location issue

* fix: eslint quotes issue

* fix: eslint quote props issue

* fix: eslint operator assignment issue

* fix: eslint new line after import issue

* fix: indent issues

* fix: operator assignment issue

* fix: all autofixable eslint issues

* fix: all react related fixable issues

* fix: autofixable eslint issues

* chore: remove all template literals

* fix: remaining autofixable issues

* fix: failing js test
2023-05-18 11:03:59 +05:00
Jenkins
f2daf37d4a chore: geoip2: update maxmind geolite country database 2023-05-17 16:58:48 -04:00