Commit Graph

73 Commits

Author SHA1 Message Date
Usama Sadiq
c14eab1332 refactor: Ran pyupgrade on openedx/core/djangoapps/site_configuration 2021-04-06 12:50:34 +05:00
Shimul Chowdhury
e942f12adc Add missing context platform_name and contact_mailing_address. And pass
site configuration to email context.
2021-03-19 10:05:49 +06: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
Aarif
98f5a886ba replaced unittest assertions pytest assertions (#26569) 2021-02-22 12:24:59 +05:00
usamasadiq
7bbde8f0f5 Applied pylint-amnesty 2021-02-08 13:00:22 +05:00
Jawayria
731ccc8ce3 Applied pylint-amnesty to openedx/core/djangoapps/{session_inactivity_timeout, signals, site_configurations} 2021-02-04 14:40:28 +05:00
Awais Jibran
64e26407f2 Logo Swap & Config for serving assets from cdn.
1. Header Logo
2. Footer Logo
3. Favicon
2020-12-03 17:30:13 +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
27480cdd2f Removed deprecated future imports 2020-06-23 18:51:43 +05:00
Ubuntu
9b52d6cb28 Added with statement to close file before returning 2020-05-27 15:17:20 +00:00
Tim McCormack
7a406d4417 Cache site config per-request to reduce DB queries from template render (#23791)
ARCHBOM-1139: We were seeing about 150 queries to the django_site table
and over 200 to memcached just to load the login page. A lot of these
are via mako template rendering, but there are other sources, and this
will hopefully nip it in the bud.
2020-04-23 15:37:45 +00:00
Manjinder Singh
96792cde56 Adding samesite cookie option in django 2.1 and above (#23571)
* Adding samesite cookie option in django 2.1 and above

Django 2.1 release note: Added the SESSION_COOKIE_SAMESITE setting to set the SameSite cookie flag on session cookies.
2020-04-02 09:57:18 -04:00
Julia Eskew
4444ffbf1a Add migration to remove values from SiteConfiguration and unskip migration test. 2020-03-06 12:42:57 -05:00
Troy Sankey
d428f7530d Revert "Revert "Rename values in SiteConfiguration (2/3) attempt #2""
This reverts commit e6f58b6d4c.

This is our third (3rd!) attempt to deploy stage 2 of this column rename.
2020-03-04 14:53:47 -05:00
Troy Sankey
06b547057e Add migration to populate site_values in SiteConfigurationHistory
Right now the ORM is very unhappy about the JSONField `site_values`
in SiteConfigurationHistory containing non-JSON (empty strings).  We
cannot even write a data migration using the ORM to populate the field
because that causes a JSONDeserializationError.  Therefore, we must
bypass the ORM and populate the values with raw SQL.

DENG-18
2020-03-02 11:44:28 -05:00
Troy Sankey
e6f58b6d4c Revert "Rename values in SiteConfiguration (2/3) attempt #2" 2020-02-27 13:24:55 -05:00
Troy Sankey
3400326e50 Fix migration issue with the missing method.
This commit fixes an issue originally in 3541643d where an instance
method on a model was missing in a migration.  The problem was that
Django is smarter than we thought, and is somehow able to construct an
older version of the model before the commit, where there was no such
method.  The solution is just to pull the method out of the model.

DENG-18
2020-02-26 14:44:14 -05:00
Troy Sankey
c422dec083 Revert "Revert "Rename values in SiteConfiguration (2/3)""
This reverts commit b85aa4b3fb.
2020-02-26 12:54:24 -05:00
Troy Sankey
b85aa4b3fb Revert "Rename values in SiteConfiguration (2/3)" 2020-02-26 11:23:56 -05:00
Julia Eskew
3541643dd5 Rename values in SiteConfiguration (2/3)
This stage does the following:

- Includes a data migration to copy the values from old to new field.
- Changes business logic to switch to using new field.
- Deletes all code references of the old field.
2020-02-25 13:54:02 -05:00
Troy Sankey
18deacde54 Revert "Revert "This stage does the following: (#22692)""
This reverts commit 84de6bc6de
which reverts commit cebeab4348
which implements the first stage of the `values` column rename in
SiteConfiguration.  However, I included a small change:

This time, we set a default value on the new `site_values` column so
that the ORM will happily deserialize the JSONField without throwing a
JSONDecodeError.
2020-02-19 12:01:57 -05:00
Aarif
41c886a42d Added migration for JSONField 2020-02-17 16:15:53 +05:00
Calen Pennington
4901dde748 Clean up pylint errors to get diff-quality to pass 2020-02-06 09:18:30 -05:00
Aarif
97d327feeb BOM-1121
Old style mixin compatibility with django2.2
2020-01-30 16:36:02 +05:00
Julia Eskew
84de6bc6de Revert "This stage does the following: (#22692)"
This reverts commit cebeab4348.
2020-01-14 13:01:21 -05:00
Julia Eskew
cebeab4348 This stage does the following: (#22692)
- Adds the new field and migration to create the column.
- Makes all writes go to both old and new field.
2020-01-14 10:40:39 -05:00
Guruprasad Lakshmi Narayanan
c9fecb1103 Update the existing 'create_site_configuration' management command
Updates the existing command, after renaming it, to allow:
* Specifying the site ID instead of the domain.
* Updating the existing site configuration parameters.
* Enabling and disabling the SiteConfiguration instance.
2020-01-09 10:34:20 -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
Ned Batchelder
b027437e80 get_all_orgs returns a set, not a list. BOM-731 2019-09-18 13:42:55 -04:00
Ayub khan
8a95a8e520 BOM-95
assertItemsEqual with six.assertCountEqual
2019-08-21 17:01:40 +05:00
Jeremy Bowman
1835ee9a45 DEPR-33 Remove microsites from site_configuration (#20922) 2019-08-08 13:02:09 -04:00
Alex Dusenbery
f307e49f94 Add an index from program type to program UUID in the catalog cache. 2019-08-06 10:31:44 -04:00
uzairr
80316c632d Update Help msgs of management commands
PROD-399
2019-08-02 15:20:26 +05:00
Zachary Hancock
0ed2e67c2b site configuration management (#20919)
site config management cmd
2019-07-01 11:07:26 -04:00
Jeremy Bowman
f9929f32b5 Update quality threshold counts (#20681) 2019-05-24 08:27:54 -04:00
amitvadhel
49b3d05375 INCR-INCR-158: Run python-modernize on openedx/core/djangoapps/site_configuration 2019-05-10 12:01:15 +03:00
Julia Eskew
368f221f0a Initial start on annotations. 2019-02-19 11:24:21 -05:00
Matthew Piatetsky
444799fb0e fix unicode strings in openedx/ part 2 2019-02-15 10:15:51 -05:00
Nimisha Asthagiri
886bc4b20b Studio login/registration redirects to LMS 2018-12-17 20:50:57 -05:00
Calen Pennington
f84c121f43 Clean up several xss linter issues 2018-11-21 12:18:10 -05:00
Calen Pennington
0cb48dfe1c Add StackedConfigurationModels for managing content_type_gating and course_duration_limits 2018-11-21 12:18:10 -05:00
Calen Pennington
996eceb6f9 Add a facility for getting the SiteConfiguration that an org belongs to 2018-10-15 13:28:30 -04:00
Jeremy Bowman
380a24f7ef TE-2689 Remove useless pylint suppressions part 6 2018-08-21 13:54:34 -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
Jeremy Bowman
da8cf6b528 PLAT-1382 Populate ALLOWED_HOSTS for tests 2017-12-05 14:22:30 -05:00
Jeremy Bowman
ba06372cac PLAT-1780 Remove dependency on django-extensions 2017-10-27 13:19:12 -04:00