Commit Graph

62 Commits

Author SHA1 Message Date
Hassan Raza
033bcda99d Hraza/add embargo restricted country (#36398)
* feat: add country disabling feature in embargo app

* revert: disabled countries list in env

* fix: resolved linter issues

---------

Co-authored-by: Hassan Raza <h.raza@192.168.1.12>
2025-03-19 12:22:45 +05:00
Ahtisham Shahid
e7100d813f Revert "feat: refactor country disable logic into the Embargo app (#36202)" (#36393)
This reverts commit 72959ad9d5.
2025-03-17 23:55:59 +05:00
Hassan Raza
72959ad9d5 feat: refactor country disable logic into the Embargo app (#36202)
* feat: add country disabling feature in embargo app

* revert: disabled countries list in env

* fix: resolved linter issues

---------

Co-authored-by: Hassan Raza <h.raza@192.168.1.12>
2025-03-17 16:07:18 +05:00
Tim McCormack
94441861e0 feat!: Remove legacy-ip code and Waffle switch (#33735)
This switch has been kept disabled in edx.org for well over a year with no
trouble, and the migration to `CLOSEST_CLIENT_IP_FROM_HEADERS`
was introduced in Nutmeg.

DEPR issue: https://github.com/openedx/edx-platform/issues/33733
2023-12-01 14:44:59 +00:00
Feanil Patel
ac2cc158f8 test: Update tests to the new return code.
When including `JwtAuthentication`, the auth_header becomes `JWT
realm="api"`. Without it, it is `None`. This changes the behavior of the
code in DRF and returns a slightly different auth response.

Relevant Code: 56946fac8f/rest_framework/views.py (L456C3-L456C3)
2023-11-01 11:03:03 -04:00
Tim McCormack
4ecd9fe683 feat!: Delete all non-legacy IP code (#31000)
The IP chain code has moved to edx-django-utils—except for the legacy-IP code,
which is now in a new module. This will allow other IDAs to use the IP code.

Commit includes some adjustments to the toggle annotation.

Part of <https://github.com/openedx/edx-django-utils/issues/241>.
2022-09-21 14:11:34 +00:00
Michael Terry
b8ecfed67d fix: use safer ip-chain logic when checking ip for embargos
Specifically:
- check ALL ip addresses in the client ip chain for blocking
- check RIGHTMOST ip address in the client ip chain for allowing

Before, we always checked the LEFTMOST ip address in both cases.

AA-1234
2022-04-22 11:15:02 -04:00
Michael Terry
ce5f1bb343 feat!: drop legacy course home view and related code
This was the "outline tab" view of the course. Preceded by the
course info view, succeeded by the MFE outline tab.

In addition to the course home view itself, this drops related
features:
- Legacy version of Course Goals (MFE has a newer implementation)
- Course home in-course search (MFE has no search)

The old course info view and course about views survive for now.

This also drops a few now-unused feature toggles:
- course_experience.latest_update
- course_experience.show_upgrade_msg_on_course_home
- course_experience.upgrade_deadline_message
- course_home.course_home_use_legacy_frontend

With this change, just the progress and courseware tabs are still
supported in legacy form, if you opt-in with waffle flags. The
outline and dates tabs are offered only by the MFE.

AA-798

(This is identical to previous commit be5c1a6, just reintroduced
now that the e2e tests have been fixed)
2022-04-14 15:18:31 -04:00
Michael Terry
a515c2e992 Revert "Drop legacy outline tab in favor of the MFE's version" 2022-04-14 14:16:29 -04:00
Michael Terry
be5c1a64d5 feat!: drop legacy course home view and related code
This was the "outline tab" view of the course. Preceded by the
course info view, succeeded by the MFE outline tab.

In addition to the course home view itself, this drops related
features:
- Legacy version of Course Goals (MFE has a newer implementation)
- Course home in-course search (MFE has no search)

The old course info view and course about views survive for now.

This also drops a few now-unused feature toggles:
- course_experience.latest_update
- course_experience.show_upgrade_msg_on_course_home
- course_experience.upgrade_deadline_message
- course_home.course_home_use_legacy_frontend

With this change, just the progress and courseware tabs are still
supported in legacy form, if you opt-in with waffle flags. The
outline and dates tabs are offered only by the MFE.

AA-798
2022-04-14 09:12:01 -04:00
Mohammad Ahtasham ul Hassan
a838ab4b01 fix: fixed django4 warnings (#29643) 2022-03-04 15:03:02 +05:00
Michael Terry
cb1bb7fa64 test: switch default test store to the split store
It's long past time that the default test modulestore was Split,
instead of Old Mongo. This commit switches the default store and
fixes some tests that now fail:
- Tests that didn't expect MFE to be enabled (because we don't
  enable MFE for Old Mongo) - opt out of MFE for those
- Tests that hardcoded old key string formats
- Lots of other random little differences

In many places, I didn't spend much time trying to figure out how to
properly fix the test, and instead just set the modulestore to Old
Mongo.

For those tests that I didn't spend time investigating, I've set
the modulestore to TEST_DATA_MONGO_AMNESTY_MODULESTORE - search for
that string to find further work.
2022-02-04 14:32:50 -05:00
Jawayria
67b44d3b45 chore: Applied lint-amnesty on openedx/core/djangoapps 2021-12-09 13:35:36 +05:00
M. Zulqarnain
834dabb399 feat: New codemods on OpenedX 2 (#28777) 2021-10-28 16:45:53 +05:00
Usama Sadiq
484cd536e2 fix: Fixed new pylint warnings (#28724) 2021-09-23 17:54:04 +05:00
Awais Qureshi
b58832c8a6 chore: Django3 has removed python_2_unicode_compatible.
Execute the codemodes.
2021-07-26 23:43:54 +05:00
Usama Sadiq
46993bff00 refactor: pyupgrade second iteration (#27461) 2021-05-11 11:24:07 +05:00
Kyle McCormick
b1fa2bdae6 refactor: make embargo app go through geoinfo API (#27350)
Consolidates all usage of geoip database within
geoinfo app.
2021-04-16 14:00:04 -04:00
Usama Sadiq
918c44e499 refactor: Ran pyupgrade on openedx/core/djangoapps/embargo (#26911) 2021-03-18 18:38:09 +05:00
M. Zulqarnain
42fc6aef03 Upgrade django-ipware (#24827) 2021-02-23 18:14:17 +05:00
Aarif
c880a44947 replaced unittest assertions pytest assertions (#26566) 2021-02-22 12:24:07 +05:00
M. Zulqarnain
39b207007c BOM-2323 : Pylint amnesty in embargo and enrollments apps (#26368)
* pylint amnesty in openedx apps
2021-02-04 15:32:59 +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
Aarif
97d327feeb BOM-1121
Old style mixin compatibility with django2.2
2020-01-30 16:36:02 +05:00
Feanil Patel
046feb0cf0 Merge pull request #22649 from edx/feanil/fix_pep8
Fix all E303 pep8 errors.
2019-12-30 13:32:26 -05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -05:00
Feanil Patel
2df8b8226b Merge pull request #22643 from edx/feanil/2to3_asserts
Run `2to3 -f asserts . -w` on edx-platform.
2019-12-30 12:13:42 -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
Feanil Patel
70294b0ad2 Run 2to3 -f asserts . -w on edx-platform.
https://docs.python.org/3.5/library/2to3.html#2to3fixer-asserts
2019-12-30 10:22:19 -05:00
Awais Qureshi
82fb16b2f7 BOM-981,983,984
Fixing migrations.
2019-10-24 14:53:39 +05:00
Ayub khan
5c47a3b425 BOM Project
Updated __unicode__ to __str__
2019-09-25 18:31:54 +05:00
Awais Qureshi
6d5ea3b7ea Merge pull request #21732 from edx/awais786/BOM-584
Awais786/bom 584
2019-09-24 14:37:37 +05:00
Awais Qureshi
62595bba75 BOM-581
Fixing python3
2019-09-20 18:32:22 +05:00
Awais Qureshi
f10df9dd5e BOM-581
Fixing python3
2019-09-20 16:30:15 +05:00
Awais Qureshi
75b5fffb87 BOM-584
Fixing python3
2019-09-20 16:11:47 +05:00
Awais Qureshi
718fb0f5b8 BOM-585
Fixing python3
2019-09-20 16:03:28 +05:00
aarif
13f9609386 python 3 fixes 2019-09-17 19:13:16 +05:00
Peter Pinch
4f807dd702 INCR-155 Modernize openedx/core/djangoapps/video_config (#20408)
* run modernizer on openedx/core/djangoapps/embargo/

* sorting imports

* sort imports

* docstring

* try removing pylint disable
2019-05-06 16:43:42 -04:00
adeelehsan
3e2764d9c0 update pygeopip to geoip2
Update deprecated pygeoip
to geoip2 and all usages
of it

Learner-6238
2019-02-21 00:42:05 +05:00
Julia Eskew
368f221f0a Initial start on annotations. 2019-02-19 11:24:21 -05:00
Matthew Piatetsky
f294b1a374 fix unicode strings in openedx/ part 1 2019-02-13 10:47:35 -05:00
Michael Youngstrom
4bbd1dee0b Remove shards from commonlib-unit tests 2019-02-12 14:28:35 -05:00
singuliere
d00cb9bda8 INCR-40 use ipaddress instead of ipaddr 2019-02-09 13:10:06 +01:00
Michael Terry
95a6f1fa9e Allow searching restricted courses by key 2018-12-19 09:09:02 -05:00
Nimisha Asthagiri
700a902b68 Cleanup and remove deprecated RequestCache Django app
ARCH-223
2018-09-12 14:39:11 -04:00
Jeremy Bowman
d90afa4cde TE-2689 Remove useless pylint suppressions part 5 2018-08-21 11:07:52 -04:00
Jeremy Bowman
c290bf8a07 TE-2524 Stop using nose.plugins - openedx 2018-08-02 14:54:50 -04:00
Tyler Hallada
1f42d1b384 Merge pull request #18316 from edx/thallada/PLAT-1524-on-delete
PLAT-1524: Add on_delete kwarg to ForeignKey & OneToOneFields
2018-06-06 10:38:15 -04:00
Tyler Hallada
1540f9ec72 Add on_delete kwarg to ForeignKey & OneToOneFields
Django 2.0 will make this field required for `ForeignKey` and `OneToOneFields`.
In previous versions the option defaulted to `models.CASCADE` when not
specified. This change should make the deprecation warnings in the current
Django version go away.

The migrations where also modified, but the changes should not cause a change in
the database schema since `models.CASCADE` was already the old default.
2018-06-05 17:05:12 -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