Commit Graph

87 Commits

Author SHA1 Message Date
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
d9b9f21e22 pylint amnesty in LMS root (#26276) 2021-02-02 12:52:24 +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
Amit
7dfb73c7a6 INCR-483: Make compatible with Python 3.x without breaking Python 2.7 support (#20795)
* reword INCR-483: Make compatible with Python 3.x without breaking Python 2.7 support

pick INCR-483: Re-run isort for lms/envs/test.py

INCR-483: change import order

INCR-483: PyLint fixes

* INCR-483: Fixes useless suppression

* INCR-483: Remove unused get_swagger_view
2019-07-02 12:54:34 -04:00
Michael Youngstrom
26b4e30833 Remove django 1.8 shim 2018-06-06 10:34:56 -04:00
bmedx
d3bbb86fe3 Shims to fix test collection errors 2017-11-13 15:45:34 -05:00
John Eskew
0279181624 Remove everything from CMS/LMS startup.py except single monkey-patch.
Move mimetype addition to common initialization.
2017-11-08 11:26:07 -05:00
Jeremy Bowman
c24a919856 PLAT-1774 Move x_module monkey-patching 2017-11-06 11:32:55 -05:00
Troy Sankey
c19eaef075 Move settings validation out of startup.py
This also creates a new app common_initialization in order to provide a
place to run initialization code common to both the LMS and CMS.
2017-11-03 12:23:54 -04:00
John Eskew
a711fb816b Merge pull request #16369 from edx/jeskew/remove_microsites_from_startup
Remove microsite configuration from LMS startup.py.
2017-11-02 15:37:49 -04:00
Jeremy Bowman
c83811f938 Merge pull request #16404 from edx/jmbowman/PLAT-1775
PLAT-1775 Move help tokens configuration from startup to settings
2017-11-01 15:02:22 -04:00
John Eskew
1a1c93e5e8 Remove orphaned pre-startup code and tests. 2017-11-01 14:04:31 -04:00
John Eskew
a36eb51a64 Move microsite config from startup.py to settings and AppConfig.ready. 2017-11-01 14:04:31 -04:00
Jeremy Bowman
2de2e3027d PLAT-1773 Delegate edx-proctoring service registration to app ready methods 2017-11-01 10:30:58 -04:00
Jeremy Bowman
d549194ba3 PLAT-1775 Move help tokens configuration from startup to settings 2017-10-31 17:04:54 -04:00
Troy Sankey
aeed9f77f7 Merge pull request #16385 from edx/pwnage101/init_app_PLAT-1772
Add an lms_initialization app
2017-10-31 16:15:00 -04:00
Troy Sankey
20b6dd5182 Move analytics initialization out of lms.startup.run
lms.startup is being removed, so initialize the analytics module in the
lms_initialization ready() method instead.
2017-10-31 14:16:32 -04:00
John Eskew
b866f35620 Remove support for COMPREHENSIVE_THEME_DIR -
all dirs must now go into COMPREHENSIVE_THEME_DIRS.
Move comprehensive theming setup section out of startup.py and into
  settings files using new 'derived' functionality.
Add 'derive_settings' at the end of all top-level Django settings files.
Move validation of comprehensive theming settings into new apps.py
  theming file.
Split theming code into code safe to run before settings are initialized
  -and- after settings are initialized.
2017-10-30 14:36:06 -04:00
John Eskew
54441488dc Add comments to docstring forbidding additional code. 2017-10-20 07:59:32 -04:00
John Eskew
a6757e47a4 Move third_party_auth settings code to ready method. 2017-10-19 16:17:31 -04:00
Tyler Hallada
4c353d9318 Create GradesService to override persistent grades 2017-07-25 11:58:08 -04:00
Uman Shahzad
8b65ca17c5 Migrate to latest, split python-social-auth.
PSA was monolothic, now split, with new features, like
a DB-backed partial pipeline. FB OAuth2 version also upped.

Partial pipelines don't get cleared except when necessary.
They persist for special cases like change of browser while
still mid-pipeline (i.e. email validation step).

Refactor, cleanup, and update of a lot of small things as well.

PLEASE NOTE the new `social_auth_partial` table.
2017-06-20 22:05:36 +05:00
Ned Batchelder
2f1936ce73 Replace context processor with new help-tokens app
This makes it possible to refer to multiple book from a single app.

This also means that Open edX branches will be able to pass bok-choy
tests (at least if the books have already been built.)
2017-04-27 10:34:09 -04:00
Clinton Blackburn
4cc7628696 Upgraded to Python Social Auth 0.2.21 to resolve migration issue 2017-03-10 23:06:02 -05:00
Sanford Student
79eaa4e2e9 update all references to instructor module 2016-10-12 10:04:32 -04:00
John Eskew
fab11b90d7 Move monkey_patch to openedx.core.djangoapps. 2016-10-06 10:16:14 -04:00
Ned Batchelder
8b1978ba6c Fix unused-import errors 2016-08-03 12:44:41 -04:00
wajeeha-khalid
986dcff626 MA-2536: get 'course_about' url in enrollment 2016-07-29 14:58:54 +05:00
Saleem Latif
6277bd27e6 Remove all usages of USE_CUSTOM_THEME and THEME_NAME from python files 2016-07-27 14:53:02 +05:00
Matt Drayer
68312bdd2d Revert "Revert "saleem-latif/WL-328: Multi-Site Comprehensive Theming""
2. Update COMPREHNSIVE_THEME_DIR to COMPREHENSIVE_THEME_DIRS
3. Update paver commands to support multi theme dirs
4. Updating template loaders
5. Add ENABLE_COMPREHENSIVE_THEMING flag to enable or disable theming via settings
6. Update tests
7. Add backward compatibility for COMPREHEHNSIVE_THEME_DIR
2016-06-30 15:19:51 +05:00
John Eskew
812aa6381e Upgrade to Django 1.8.11. Remove monkey patch required for v1.8.10. 2016-03-08 11:41:33 -05:00
John Eskew
ccb07f1c49 Monkey patch django.utils.http.is_safe_url for Django 1.8.10. 2016-03-03 16:53:42 -05:00
Bill DeRusha
bec6971ae2 Monkey patch django.db.models.options for faster cache expiry 2016-02-29 17:37:17 -05:00
Matjaz Gregoric
9b89bd3245 Make comprehensive theme work with django templates.
Comprehensive theming did not work with django templates (used by course wiki).

The reason it didn't work was that in order for the theme to work, theme template folder
has to be added to django template dirs setting *before* django startup.
After django startup, modifying `settings.DEFAULT_TEMPLATE_ENGINE['DIRS']` has no effect,
because at that point the template engine is already initialized with a copy of the
template dirs list.

Instead of running the theme startup code as an autostartup hook, we manually run it
*before* `django.setup()`. This is fine because theme startup code doesn't have to do
anything else besides modifying some settings and doesn't actually need django to be
initialized.
2016-01-25 08:45:52 +01:00
Felipe Montoya
4742e661f4 Creating a settings object that is aware of the microsite settings.
Adding the declaration of the settings object to openedx.conf to be able to import it from a nicer location

Resolving quality violations

Merging dicts with the settings definition when they exist in the microsite configuration

Using a cache to improve the perfomance of quering any dictionary in the microsite definition

Ignoring the invalid-name pylint warning since the names must be kept thsi way to stay the same as the ones in django.
Removing the default dict argument as per https://docs.python.org/2/tutorial/controlflow.html#default-argument-values

Extracting the implementation of the microsite to a selectable backend.

Leaving the function startup.enable_microsites for backwards compatibilityy

Adding a database backend

Using a cache to improve the perfomance of quering any dictionary in the microsite definition.
Changed the database backend so that it extends the settings file backend and removed all the unnecessary methods.

Using the backend provider for the get_dict function

some tweeks and some initial unit tests

Using getattr as a function insteal of calling the underlying __getattr__ directly

Adding an ModelAdmin object for the microsite model in the django-admin panel

refactor enable_microsites()

consolidate/refactor some shared code

add config to aws.py and add migration files

fix tests

Changes to get the backends to run after the refactor

add archiving capabilities to microsites. Also make a few notes about performance improvements to make

fix tests

Making the query to find if microsites exist in the database faster

add ORG to microsite mapping tables and some performance improvements

allow for Mako templates to be pulled from the database

fix tests

For the database template backend the uri of the template does not use the filesystem relative path

Fixing pylint violations

Added caching of the templates stored in the database

Fixing pylint errors

fix pylint

Clearing the cache on model save

Fixing pylint errors

rebased and added test coverage

rebased cdodge/microsite-improvements branch with master and added test
coverage

added missing migration

fix quality violations

add more test coverage

mattdrayer: Add microsite_configuration to cms.INSTALLED_APPS

added microsite settings to cms/envs/test.py

run session cookie tests only in LMS

fixed broken tests

putting middleware changes back

Preventing the template_backend to be called on requests which have no microsite

changes to address feedback from mjfrey

changed BaseMicrositeBackend to AbstractBaseMicrositeBackend

changes after feedback from mattdrayer

fixed broken tests and quality violations

Allowing the backend to handle the enable_pre_startup routine

Typos and docstrings

Adressing feedback

Fixing python tests

add comment to explain why we need enable_microsites_pre_startup()
2016-01-15 14:52:36 +05:00
Felipe Montoya
f2a6a27ec9 Adding support for microsite template_paths on django templates
Stripping the leading / for the django_templates finder

Enabling the microsite configurations before running django.setup()

Adding only the templates directory before startup

Adding the missing overrides file at the django templates main

Using the comp_theming way of overriding css

Adding test for the microsite_template_path filter
2016-01-12 10:34:00 -05:00
Ned Batchelder
f5d0f3ff55 Remove useless pylint suppressions 2015-11-22 07:41:19 -05:00
Usman Khalid
6cb62f2697 Rebase upgrade Django to v1.8.5
Please note that this is a squshed commit and the work of:
Symbolist, macdiesel, nedbat, doctoryes, muzaffaryousaf and muhammad-ammar
2015-11-10 15:00:19 -05:00
chrisndodge
7868067879 Merge pull request #9744 from edx/cdodge/timed-exams
Timed Exams
2015-10-30 11:03:59 -04:00
Muhammad Shoaib
9476898df0 Add Timed Exams as a feature to edx-platform 2015-10-30 08:44:33 -04:00
David Ormsbee
9b88bdb072 Changes to handler URL generation
* The LMS now also monkey-patches
  xmodule.x_module.descriptor_global_handler_url and
  xmodule.x_module.descriptor_global_local_resource_url so that we can
  get LMS XBlock URLs from the DescriptorSystem. That functionality is
  needed in the block transforms collect() phase for certain XModules
  like Video. For instance, say we want to generate the transcripts
  URLs. The collect phase is run asynchronously, without a user context.

* The URL handler monkey-patching is now done in the startup.py files
  for LMS and Studio. Studio used to do this in the import of
  cms/djangoapps/contentstore/views/item.py. This was mostly just
  because it seemed like a sane and consistent place to put it.

* LmsHandlerUrls was removed, its handler_url and local_resource_url
  methods were moved to be top level functions. The only reason that
  class existed seems to be to give a place to store course_id state,
  and that can now be derived from the block location.

* To avoid the Module -> Descriptor ProxyAttribute magic that we do
  (which explodes with an UndefinedContext error because there is no
  user involved), when examining the block's handler method in
  handler_url, I made a few changes:

** Check the .__class__ to see if the handler was defined, instead of the
   block itself.

** The above required me to relax the check for _is_xblock_handler on the
   function, since that will no longer be defined.

90% of this goes away when we kill XModules and do the refactoring we've
wanted to do for a while.
2015-10-28 09:42:59 -04:00
Bill DeRusha
bcb71a3255 Rename SEGMENT_KEY to have a unique key name for both CMS and LMS 2015-10-01 19:40:27 -04:00
Bill DeRusha
a6873cb883 Merge pull request #9875 from edx/bderusha/segment-cleanup
Segment Clean Up
2015-09-29 10:33:03 -04:00
Bill DeRusha
14e1ef13fe Merge pull request #9865 from edx/bderusha/segment-version-bump
Bump version of segemnt's analytics-python package to 1.1.0
2015-09-29 09:33:49 -04:00
Brian Beggs
d9de52751d Merge remote-tracking branch 'origin/release' into bbeggs/2015-09-22-release-to-master 2015-09-28 20:58:34 -04:00
Ben Patterson
2fd6add524 Revert "Merge DRF 3.1 in to master" 2015-09-28 17:12:43 -04:00
Will Daly
d11ccad0fc Upgrade djangorestframework to v3.1
* Upgrade edx-submissions
* Upgrade edx-ora2
* Upgrade edx-val
* Upgrade edx-proctoring
* Update all edx-platform code that depends on DRF, including:
  - auth_exchange
  - cors_csrf
  - embargo
  - enrollment
  - util
  - commerce
  - course_structure
  - discussion_api
  - mobile_api
  - notifier_api
  - teams
  - credit
  - profile_images
  - user_api
  - lib/api (OAuth2 and pagination)
2015-09-28 11:52:30 -04:00
Will Daly
8555630df7 Upgrade djangorestframework to v3.1
* Upgrade edx-submissions
* Upgrade edx-ora2
* Upgrade edx-val
* Upgrade edx-proctoring
* Update all edx-platform code that depends on DRF, including:
  - auth_exchange
  - cors_csrf
  - embargo
  - enrollment
  - util
  - commerce
  - course_structure
  - discussion_api
  - mobile_api
  - notifier_api
  - teams
  - credit
  - profile_images
  - user_api
  - lib/api (OAuth2 and pagination)
2015-09-25 12:40:57 -04:00
Bill DeRusha
c721ff5a82 Replace SEGMENT_IO_LMS & SEGMENT_IO_LMS_KEY with single key SEGMENT_KEY 2015-09-24 11:49:03 -04:00