59 Commits

Author SHA1 Message Date
Feanil Patel
908aca4409 fix: Remove unused bad validation for images.
The `CourseRunImageField` is a subclass of the DRF
`serializers.ImageField` serializer and that class ignores the
`default_validators` and actually just uses Django's image validation
which is already correct and does in fact validate that the image content
is correct not just that the image extension is correct.

The DRF code that does the validation:
https://github.com/encode/django-rest-framework/blob/main/rest_framework/fields.py#L1621-L1628

Which actually just calls the Django Image Validators.

The Django Field definition:
https://github.com/django/django/blob/main/django/forms/fields.py#L712

And you can see that in the
[`to_python`](https://github.com/django/django/blob/main/django/forms/fields.py#L721)
function of that class it actually checks the image content.

This function is never actually called and so it's just misleading.
2026-01-12 12:58:21 -05:00
Emad Rad
6a046ebe50 chore: fixed typos 2025-12-11 11:46:44 -05:00
leoaulasneo98
1dfe43af76 Edx platform 35175 deprecate assert dict contains subset (#36236)
* fix: replace deprecated assertDictContainsSubset with assertEqual
2025-03-25 14:58:16 +05:00
Navin Karkera
5e51e2d5b7 fix: swagger docs ref_name conflicts (#36189)
* fix: swagger docs ref_name conflicts

* fix: swagger auto doc errors

* chore: bumps openedx-learning==0.18.2

---------

Co-authored-by: Jillian Vogel <jill@opencraft.com>
2025-01-30 20:32:18 +05:30
github-actions[bot]
6945bfae61 feat: Upgrade Python dependency edx-enterprise (#35046)
* feat: Upgrade Python dependency edx-enterprise

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

* fix: one space to force push

---------

Co-authored-by: kiram15 <31229189+kiram15@users.noreply.github.com>
Co-authored-by: Kira Miller <kira.miller15@yahoo.com>
2024-06-27 14:42:00 -06:00
Pooja Kulkarni
3c7e16255a feat: add new endpoint for cloning course (#31794)
Co-authored-by: Maxim Beder <maxim@opencraft.com>
2024-04-09 15:05:10 +05:30
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
Usama Sadiq
4ee5964855 fix: fix django4 deprecation warnings (#32957) 2023-08-16 14:39:49 +05:00
Ahtisham Shahid
0815d7a0cd fix: skip update_discussions_settings_from_course_task if rerun is not completed (#32036) 2023-04-06 18:30:45 +00:00
Ahtisham Shahid
f83d8c7059 fix: changed rerun task sequence (#32035) 2023-04-05 22:36:17 +00:00
Ahtisham Shahid
d483d0df3d fix: changed rerun task sequence (#32033) 2023-04-05 16:17:04 +00:00
Ahtisham Shahid
8eb324ae51 fix: added disucssions task in course rerun from publisher (#32028) 2023-04-05 11:56:14 +05:00
Jawayria
c320d5cd1b fix: replace 'django.conf.url()' with 'django.urls.re_path()' 2021-12-14 19:53:24 +05:00
Jawayria
59631c4825 chore: Applied lint-amnesty on cms/djangoapps 2021-12-10 19:14:36 +05:00
edX requirements bot
bb20b17428 Python Requirements Update (#29516)
* chore: Updating Python Requirements

* fix: fix pylint issues

Co-authored-by: Mohammad Ahtasham ul Hassan <mohammad.ahtasham@arbisoft.com>
2021-12-08 14:13:27 +05:00
M. Zulqarnain
e54fb5f76e feat: New codemods on CMS (#28768) 2021-10-25 12:59:54 +05:00
Kyle McCormick
9aefd6f986 style: django-not-configured is not a sensible lint-amnesty value (#26862)
django-not-configured is an error raised by pylint (with
the pylint-django plugin) when it's not correctly configured.

We should not be applying lint amnesty for such a violation.
2021-03-05 08:11:58 -05:00
M. Zulqarnain
5562944e87 BOM-2369 (A): pyupgrade on api,contentstore and cms_user_tasks apps under CMS (#26676)
* pyupgrade on cms api,contentstore and cms_user_tasks apps
2021-03-04 15:06:07 +05:00
usamasadiq
7bbde8f0f5 Applied pylint-amnesty 2021-02-08 13:00:22 +05:00
Kyle McCormick
4dda73d797 [BD-14] Migrate all environments to use database-backed organizations (#25153)
* Install `organizations` app into LMS and Studio non-optionally.
* Add toggle `ORGANIZATIONS_AUTOCREATE` to Studio.
* Remove the `FEATURES["ORGANIZATIONS_APP"]` toggle.
* Use the new `organizations.api.ensure_organization` function to
  either validate or get-or-create organizations, depending
  on the value of `ORGANIZATIONS_AUTOCREATE`,
  when creating course runs and V2 content libraries.
  We'll soon use it for V1 content libraries as well.
* Remove the `util.organizations_helpers` wrapper layer
  that had to exist because `organizations` was an optional app.
* Add `.get_library_keys()` method to the Split modulestore.
* Add Studio management command for backfilling organizations tables
  (`backfill_orgs_and_org_courses`).

For full details, see
https://github.com/edx/edx-organizations/blob/master/docs/decisions/0001-phase-in-db-backed-organizations-to-all.rst

TNL-7646
2020-12-02 13:58:40 -05:00
Kyle McCormick
151bd13666 Use full names for common.djangoapps imports; warn when using old style (#25477)
* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
2020-11-10 07:02:01 -05:00
Kyle McCormick
a3deb6e317 Sort imports in cms/
Command: `isort --recursive cms/`
2020-10-19 09:34:31 -04:00
Kyle McCormick
538dbf696b Import CMS code using fully qualified module names
or, using proper the proper Python 3 relative imports
(e.g., 'from .views import x') which are standard and
unambiguous.
2020-10-19 09:34:31 -04:00
Kyle McCormick
793df96332 Declare CMS apps using fully qualified names 2020-10-19 09:34:31 -04:00
Aarif
98af9ce418 remove useless-supression warnings 2020-05-01 19:42:15 +05:00
Jeremy Bowman
e1d1c29c00 Fix DRF deprecation warnings (#23082)
Fix all deprecation warnings generated by Django REST Framework during the unit tests:

* ``The `base_name` argument is pending deprecation in favor of `basename`.`` (86 occurrences)
* `` `detail_route` is deprecated and will be removed in 3.10 in favor of `action`, which accepts a `detail` bool. Use `@action(detail=True)` instead.`` (18 occurrences)
2020-02-12 12:51:40 -05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -05:00
Feanil Patel
61e1eda20d Merge pull request #22644 from edx/feanil/2to3_imports
Run `2to3 -f future . -w`
2019-12-30 11:21:05 -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
Awais Qureshi
928a84f969 BOM-1117
Specifying a namespace in django.conf.urls.include() without providing an app_name is deprecated.
Adding the app_name attribute in the included module.
2019-12-30 18:08:21 +05:00
Waheed Ahmed
23bc5af0fc Fix course:org link creation upon rerun.
Upon rerun creation from publisher course:organization link
was not creating, due to which org logo was not appearing on
course certificates.

Fixed by creating course:org link upon rerun.

PROD-125
2019-08-05 13:48:50 +05:00
Dillon Dumesnil
e5fbfb02c6 DISCO-1222: Allow switching course numbers for reruns
Adds in tests for the new functionality while maintaining the old Validation Error message
2019-07-31 10:42:09 -04:00
aarif
e39485d94d ran python-modernize and isort on files mentioned in INCR-343
changes made to comply with quality
2019-07-16 11:54:40 +00:00
Ayub
1a9648a07e Revert "ran python-modernize and isort on files mentioned in INCR-343 (#21014)"
This reverts commit 87e58c86cc.
2019-07-15 16:44:13 +05:00
Aarif
87e58c86cc ran python-modernize and isort on files mentioned in INCR-343 (#21014) 2019-07-15 14:39:27 +05:00
Ned Batchelder
b3a731550c Fix problems that drf-yasg uncovered.
These were originally fixed individually, but had to be reverted, and
are now combined in one commit.  The originals were:

7b9040f6b0 This enum was backwards
8774ff1f9b Use ref_name to disambiguate serializers that drf-yasg would otherwise assume are the same.
8a44397139 Is this field missing because it is None?
4a1154a7ca Give a safer buffer for clearing the rate limiting
64c47856dd DRF 3.7.4 changed how you delegate to another view, so don't
7359ca4fb2 Is this right? It fixes two tests
fdd66e5390 Adjust the expected error message for DRF 3.7.7
9257f68fd8 The default TIME_ZONE should be UTC
2019-06-21 18:04:15 -04:00
Ned Batchelder
5dcb8bac33 Merge pull request #20802 from edx/revert-20393-nedbat/drf-yasg
Revert "Use drf-yasg for Open API documentation"
2019-06-11 16:34:21 -04:00
Amit
2f6935863a INCR-344 (#20785) 2019-06-11 16:11:46 -04:00
Ned Batchelder
39c7a2db7c Revert "Use drf-yasg for Open API documentation" 2019-06-11 16:05:00 -04:00
Ned Batchelder
7b9040f6b0 This enum was backwards 2019-06-10 15:27:39 -04:00
Awais Jibran
3bfab9fd32 Adding more timing logs as course-rerun is slow for mitx-7.00x 2019-03-22 15:41:57 +05:00
asadazam93
a4071324e0 Added logs 2019-03-12 16:55:00 +05:00
Matthew Piatetsky
7df30938c4 fix unicode strings in cms/ 2019-02-04 13:01:51 -05:00
Ned Batchelder
fae196a89b Don't use async as an identifier 2018-11-02 06:10:13 -04:00
Robert Raposa
fbc59231fc Update edx-drf-extensions to 2.0.0.
Note: this version update is backward incompatible.

ARCH-255
2018-10-17 01:00:34 -04:00
Eric Fischer
247bb50ed2 s/django.core.urlresolvers/django.urls/g
Django 1.10 deprecation fix for Hackathon XIX
Addresses PLAT-1397
2018-06-05 13:59:09 -04:00
rabia23
f65195c0ed EDUCATOR-2231 remove course run enrollment dates references from studio 2018-03-05 11:27:22 +00:00
Awais Jibran
1e16bfd936 On course run create request, validate course team user and raise validation error 2018-02-01 14:17:35 +05:00
Asad Azam
1f5134b5ef Fixed multiple CourseAccessRole error on publish 2017-12-28 15:42:41 +05:00
Clinton Blackburn
8a5782eb6e Updated Studio API to expose course run pacing type
The pacing type can now be read and updated.

EDUCATOR-1464
2017-10-04 10:16:45 -04:00