69 Commits

Author SHA1 Message Date
Muhammad Sameer Amin
cb76eb5aa4 fix: Handle None identity providers in _user_has_social_auth_record 2025-01-28 18:32:30 +05:00
Agrendalath
1beacdaf2c fix: handle missing name in readonly enterprise account fields
The `settings.ENTERPRISE_READONLY_ACCOUNT_FIELDS` list can be overridden.
Removing the `name` from it should not raise the `ValueError` exception.
2024-09-30 22:56:38 +02:00
Diana Huang
3946503960 Revert "feat: Update the cache when active enterprise is changed. (#30866)" (#30870)
This reverts commit 354d2be845.
2022-08-17 12:18:04 -04:00
Zaman Afzal
354d2be845 feat: Update the cache when active enterprise is changed. (#30866) 2022-08-17 17:29:21 +05:00
Eugene Dyudyunov
8bd43207ca refactor!: switch from LegacyWaffle* to modern waffles (#30330)
This is a first stage for removing the LegacyWaffle* classes.

LegacyWaffleFlag usage replaced with WaffleFlag;
LegacyWaffleSwitche usage replaced with WaffleSwitch;
New CourseWaffleFlag added to the temporary module __future__ as FutureCourseWaffleFlag;
Updated all the imports to use CourseWaffleFlag from the __future__ module;

BREAKING CHANGE: A number of toggle related constants (e.g. ENABLE_ACCESSIBILITY_POLICY_PAGE)
changed types. They were strings, and are now toggle instances (e.g. WaffleSwitch). Although the entire
refactor should be self-contained in edx-platform, if any plugins or dependencies were directly
using these constants, they will break. If this is the case, try to find a better publicized way of
exposing those toggles.
2022-05-05 12:03:10 -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
M. Zulqarnain
7aadf55387 feat: New codemods on OpenedX 4 (#28779) 2021-11-01 18:05:02 +05:00
Long Lin
34418a2667 fix: check enterprise_enabled in is_enterprise_learner 2021-10-20 10:49:30 -04:00
RehanAziz
3633cdbc01 feat: Added support for enterprise id in course_grade_passed_first_time event 2021-09-28 18:52:15 +05:00
David Ormsbee
03382ae400 revert: feat: Added support for enterprise id in course_grade_passed_first_time event" (#28831) 2021-09-23 17:56:07 -04:00
RehanAziz
1fffdc66fc feat: Added support for enterprise id in course_grade_passed_first_time event 2021-09-09 13:44:25 +05:00
irfanuddinahmad
19f79a7165 Added util method for course access verification 2021-05-17 22:22:12 +05:00
Usama Sadiq
2b55959a8e refactor: apply lint-amnesty on existing violations 2021-04-20 23:51:31 +05:00
Muhammad Ammar
9d7e804236 Merge pull request #27255 from edx/ammar/update-cache-key-for-dsc
update cache key for DSC
2021-04-07 15:27:42 +05:00
Zaman Afzal
194f29ca55 ENT4134 Add the support for multiple IDPs (#27073)
* ENT4134 Add the support for multiple IDPs
2021-04-06 23:27:20 +05:00
muhammad-ammar
3929d098b6 update cache key for dsc 2021-04-06 17:34:42 +05:00
Awais Qureshi
d24f79a264 BOM-2442
pyupgrade in enterprise_support
2021-03-11 14:54:23 +05:00
Alexander Sheehan
6ef93078f9 adding unit tests for assessment level reporting and hashing cache key. 2020-12-09 10:07:46 -08:00
Alexander Sheehan
66e0f6bf5d caching enterprise learner lookup 2020-12-08 14:51:40 -08:00
Régis Behmo
a16cd71046 Start waffle namespace deprecation
By explicitly importing the legacy namespace classes, we make it clear
that we are using soon-to-be-deprecated classes. We will then be able to
start removing the legacy classes, one module at a time.
2020-12-03 16:06:14 +01:00
Alex Dusenbery
341c1c98e5 ENT-3503 | Add unit tests to cover 100% of openedx.features.enterprise_support.utils, all in a single test file. 2020-11-23 14:52:41 -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
Régis Behmo
4586002956 Import waffle classes from edx_toggles instead of waffle_utils
Those classes were ported to edx_toggles. The imports remain in
waffle_utils.__init__ for backward compatibility.
2020-11-03 19:25:37 +01:00
Jeff Chaves
d25d4038fd ENT-3460: updating usage of EnterpriseCustomerBrandingConfiguration, edx-enterprise 3.8.42 (#25376)
* bumping enterprise version

* adding pillow constraint

* updating usage of EnterpriseCustomerBrandingConfiguration
2020-10-19 16:42:16 -04:00
Alex Dusenbery
98719faca8 Revert "bumping enterprise version to 3.8.35 (#25342)"
This reverts commit 5bf54d696a.
2020-10-14 19:56:55 -04:00
Jeff Chaves
5bf54d696a bumping enterprise version to 3.8.35 (#25342)
* bumping enterprise version

* fixing platform tests broken by branding config changes
2020-10-14 14:42:39 -04:00
Alex Dusenbery
4bb1914ec6 ENT-3367 | Show at most 1 Enterprise Learner Portal dashboard link in the header user-menu. Also, guard against no branding config when getting learner portal data. 2020-09-18 10:23:32 -04:00
Régis Behmo
307457a255 Simplify hack to obtain waffle module names
Instead of going up the stacktrace to find the module names of waffle
flags and switches, we manually pass the module __name__ whenever the
flag is created. This is similar to `logging.getLogger(__name__)`
standard behaviour.

As the waffle classes are used outside of edx-platform, we make the new
module_name argument an optional keyword argument. This will change once
we pull waffle_utils outside of edx-platform.

Note that the module name is normally only required to view the list of
existing waffle flags and switches. The module name should not be
necessary to verify if a flag is enabled. Thus, maybe it would make
sense to create a `add` class methor similar to:

    class WaffleFlag:
        @classmethod
        def add(cls, namespace, flag, module):
            instance = cls(namespace, flag)
            cls._class_instances.add((instance, module))
2020-09-14 09:30:24 +02:00
Jeff LaJoie
4282530faf Fixes session caching for enterprise portal links by only caching for auth'd learners 2020-07-30 09:18:35 -04:00
Jeff Chaves
e1bd970b46 ENT-2894: Use new welcome template when redirected from enterprise proxy login view (#24587)
* using new welcome template when redirected from enterprise proxy login view

* enabling safe redirects to enterprise learner portal from login in devstack

* ading admin portal to login redirect whitelist

* running make upgrade to version bump edx-enterprise
2020-07-24 17:40:42 -04:00
Jeff LaJoie
bf11b68fda ENT-2893: Updates header branding and href for Enterprise learners 2020-07-17 08:59:43 -04:00
Binod Pant
167d8f278f ENT-3007 : round 2 API endpoints for samlproviderconfig and samlproviderdata (#24456)
* ENT-3007 auth/saml/v0/saml/providerdata and auth/saml/v0/saml/providerconfig endpoints

Move code to subfolder for samlproviderconfig

extra comma

undo accidental remove of import

GET works for a single config now

Use ModelViewSet to get all CRUD method. Test still fails

Add auth/saml/v0/providerdata endpoints

fixup reverse and test issue, remove leading caret

just triggering run, why is it failing in CI?

pycodelint fixes

Skip auth tests unless feature is on

Tests for post/put for samlproviderdata

move urls to their own folders

api tests for post samlprovierconfig

create 1 providerconfig test case

lint fixes

lint

lint

cleanup code local urls /samlproviderconfig works

note needed right now

Fix import errors

lint

unused import

wip: first attempt at rbac auth and jwt cookie in test

round 2 with enterprise uuid as url param for samlproviderconfig

improve tests, still dont pass

fix test by using system role, wip other test

fix create test

add get/post tests for providerdata

isort fixes

string lint fix

Cleanup based on feedback round1

move utils to tests package

Move util fn to openedx.feature area

lint

ENT-3007 : Round 2 of work on auth/saml/v0/providerconfig and auth/saml/v0/providerdata endpoints

* Fix test issue use string uuid for permission obj

* snake case changes provider_config

* snake case

* provider_data, tests and lint

* patch and delete tests for providerdata

* snake_case

* snake_case

* snake_case

* make patch test stronger

* 404 if invalid uuid for get param

* common util for validate uuid4

* unused import

* lint fixes for pycodestyle

* 400 when uuid is missing

* 400 instead of 404 for missing uuid

* spell fix

* update docstring for api usage

* docstring clarify
2020-07-15 10:34:26 -04:00
Feanil Patel
5470ce5805 Revert "ENT-3007 : Add auth/saml/v0/providerconfig|data CRUD endpoints for use in admin portal (#24298)"
This reverts commit 96ddcdc288.
2020-07-10 13:38:30 -04:00
Binod Pant
96ddcdc288 ENT-3007 : Add auth/saml/v0/providerconfig|data CRUD endpoints for use in admin portal (#24298)
* Add auth/samlproviderconfig CRUD endpoints for use in admin portal

Fixes: ENT-3007

* Move code to subfolder for samlproviderconfig

* extra comma

* undo accidental remove of import

* GET works for a single config now

* Use ModelViewSet to get all CRUD method. Test still fails

* Add auth/saml/v0/providerdata endpoints

* fixup reverse and test issue, remove leading caret

* just triggering run, why is it failing in CI?

* pycodelint fixes

* Skip auth tests unless feature is on

* Tests for post/put for samlproviderdata

* move urls to their own folders

* api tests for post samlprovierconfig

* create 1 providerconfig test case

* lint fixes

* lint

* lint

* cleanup code local urls /samlproviderconfig works

* note needed right now

* Fix import errors

* lint

* unused import

* wip: first attempt at rbac auth and jwt cookie in test

* round 2 with enterprise uuid as url param for samlproviderconfig

* improve tests, still dont pass

* fix test by using system role, wip other test

* fix create test

* add get/post tests for providerdata

* isort fixes

* string lint fix

* Cleanup based on feedback round1

* move utils to tests package

* Move util fn to openedx.feature area

* lint

* lint fix

* remove unused import
2020-07-10 11:23:13 -04:00
hasnain.naveed
c51dc9db20 ENT-2818 | Added enterprise slug login's url on edx login page. 2020-05-28 19:58:46 +05:00
HammadAhmadWaqas
11893ad69e refactored imports from edx-django-utils 2020-04-20 12:11:28 +05:00
HammadAhmadWaqas
b4ebe11a6b removed get_cache_key and using it from edx-django-utils. 2020-04-13 12:51:39 +05:00
Aarif
6ee2089077 fixed warnings for wrong-import-order 2020-04-08 23:43:06 +05:00
zia.fazal@arbisoft.com
2453bc8c05 Stop showing hitting enterprise API in case of 404 error
Stop showing hitting enterprise API when request is originated as result of 404 error.

fixed quality violations

Removed line break

add unit tests

Updated test docstring
2020-02-14 15:16:51 +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
Zaman Afzal
c07268d1b5 Fix the broken privacy page link url on enterprise login page (#22528) 2019-12-30 14:57:28 +05:00
hasnain-naveed
057f443a26 ENT-2437 | get_enterprise_customer_for_learner method replaced with enterprise_customer_for_request. 2019-11-08 15:47:52 +05:00
Manjinder Singh
79c9231128 Revert "ENT-2437 | get_enterprise_customer_for_learner method replaced with e…" (#22248) 2019-11-05 16:51:44 -05:00
hasnain-naveed
4b827d5be0 ENT-2437 | get_enterprise_customer_for_learner method replaced with enterprise_customer_for_request. 2019-11-01 17:19:56 +05:00
muhammad-ammar
fc2915b02f allow user to edit fullname if no social auth record
ENT-1964
2019-10-18 15:30:51 +05:00
Feanil Patel
4eaf875741 BOM-621 Fix hashing in a bunch of places. 2019-09-19 15:53:39 -04:00
Awais Jibran
1a4eb7d2e8 Pervent reverse tabnabbing in edx platform 2019-08-28 16:08:34 +05:00
Nimisha Asthagiri
d2d6f81278 Account API: Fix Enterprise enforcement when NOT sync profile_data
ARCH-740
2019-05-03 13:44:22 -04:00