Commit Graph

26 Commits

Author SHA1 Message Date
Usama Sadiq
3e6b3e41f8 refactor: remove unused imports (#27084) 2021-03-24 17:55:04 +05:00
Awais Qureshi
8f4491e927 Pyupgrade in common/djangoapps/third-party-modes/ 2021-03-18 11:26:19 +05:00
Jawayria
7be5a683aa Applied pylint-amnesty to third_party_auth 2021-02-03 13:37:05 +05:00
Kyle McCormick
b626a43fa1 fix: Rename some tasks to match new import paths (#26236)
Several tasks are explicitly named as (or like)
their old, deprecated import path.

The issue here is that django-user-tasks listens for task
invocations, and attempts to import the task based on its name.
If the task name is completely wrong, user-tasks will catch
the ImportError and move on.
If the task is a valid *deprecated* import, though, then
user-tasks will choke on the raised `DeprecatedEdxPlatformImportError`.

Thus, we must rename three tasks to their new full path:
1. entitlements.expire_old_enrollments
2. third_party_auth.fetch_saml_metadata
3. student.send_activation_email

The first two are run daily, and so are safe to be
renamed in place.

The third task must be renamed using an expand-contract
pattern; otherwise, we would drop hundreds of tasks
during the App vs. Worker out-of-sync version window
that happens at deployments.
This commit is the expand phase.
2021-02-02 10:26:08 -05:00
Muhammad Soban Javed
d26a59eb67 import task decorator from celery APP instance in CMS (#25953)
* import task decorator from celery APP instance instead of celery package in CMS

* replaced task decorator with shared_task in cms and common

* Fixed import of shared_task

* Fixed import
2021-01-27 18:35:11 +05:00
Robert Raposa
8eef18710d set code_owner for celery tasks
ARCHBOM-1260

Co-authored-by: Tim McCormack <tmccormack@edx.org>
2020-11-17 15:33:33 -05:00
Kyle McCormick
73739189c5 Undo renames of common.djangoapps tasks (#25566)
When rolling out #25477, we dropped hundreds of email activation
tasks due to the renaming of student.send_activation_email
to common.djangoapps.student.send_activation_email,
and lost more when we rolled that PR back.
This happens because of blue/green deployment:
old workers are still online for a while after deploying,
so there is a period of time when the task names are mismatched.

To prevent this from happening again, this will make
it so the import changes don't change the names of
any of the Celery tasks.
2020-11-10 16:31:48 -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
Jeremy Bowman
59768e7498 Fix more deprecation warnings (#23061) 2020-02-10 13:17:25 -05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -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
Ayub khan
83bc838fae python 3 compatibility 2019-07-19 10:02:38 -04:00
Matthew Piatetsky
9681ca36b8 fix unicode strings in common/ 2019-02-05 10:57:00 -05:00
Brittney Exline
682ec886ed ENT-943 Refactoring third_party_auth models 2018-04-05 15:19:58 -04:00
Jeremy Bowman
5289c7e828 PLAT-1915 Stop using deprecated BaseException.message 2018-01-31 17:22:01 -05:00
Brittney Exline
c4670a33d7 ENT-839 Add ability to configure SP metadata for an IdP 2018-01-30 11:37:46 -05:00
Jeremy Bowman
1a7753d775 PLAT-1881 Fix datetimes lacking timezone information 2018-01-10 14:33:01 -05:00
Andy Armstrong
93235d118d Reorder imports using isort (except lms and cms) 2017-05-30 16:04:54 -04:00
Matt Drayer
b64503848c Add SAML metadata refresh control flag
mattdrayer: Change model fieldname, revise code, fix bad tests.
2017-04-02 16:47:20 -04:00
Saleem Latif
befe3052c9 Update saml --pull command to raise error when it fails. 2016-12-13 12:36:38 +05:00
Douglas Hall
f806f3a165 Merge pull request #13474 from open-craft/bdero/site-sso
ENT-16 Make SSO configurable per Site
2016-09-26 14:54:40 -04:00
Brandon DeRosier
3dcf689ee2 Implement Site settings for Third Party Auth providers 2016-09-26 12:43:00 -04:00
Jesse Shapiro
45bca67f79 Set up type conversion in third_party_auth to allow cacheDuration attribute to work 2016-09-26 10:28:39 -04:00
Ned Batchelder
f5d0f3ff55 Remove useless pylint suppressions 2015-11-22 07:41:19 -05:00
Braden MacDonald
4487b6d184 Fix errors with fetching Shibboleth metadata 2015-06-30 20:50:45 -07:00
Braden MacDonald
00226bf3c0 Asynchronous metadata fetching using celery beat - PR 8518 2015-06-26 13:24:00 -07:00