Commit Graph

4163 Commits

Author SHA1 Message Date
Zaman Afzal
363a75cc99 ENT-2518 Fix Enterprise Login Page not showing to the user (#22602) 2020-01-01 15:18:45 +05:00
David Ormsbee
3f0281dd66 Fix test that assumes 2020 is in the future. 2019-12-31 17:25:02 -05:00
Aarif
e607657a73 Merge pull request #22620 from edx/on_delete_parameter
Added on_delete parameter to models
2019-12-31 15:23:47 +05:00
David Ormsbee
2cb2265ffe Add request caching to reduce ORM queries
This adds request caching to the following places:
* course expiration wrapper (displayed in Units)
* offer banner generation (displayed in Units)
* get_enrollment
* user_by_anonymous_id
* youtube_disabled_for_course

On a sample course with edx-val enabled, this reduced the queries
for a large sequence from 450 to 155.
2019-12-30 16:19:25 -05:00
David Ormsbee
db30d8f447 Merge pull request #22631 from appsembler/omar/iexact__in
Safer CourseOverview.org filed matching
2019-12-30 14:59:13 -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
61e1eda20d Merge pull request #22644 from edx/feanil/2to3_imports
Run `2to3 -f future . -w`
2019-12-30 11:21:05 -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
4d310438fa Merge pull request #22605 from edx/awais786/BOM-1117
BOM-1117
2019-12-30 20:15:00 +05:00
Jeremy Bowman
63574e12b8 Remove pytest version constraint (#22626)
Fix the issue that was preventing us from upgrading pytest.  pytest does some manipulation of test packages that prevents `pkg_resources` from loading resources from them, but used to contain a workaround for the problem.  That workaround was [removed](https://github.com/pytest-dev/pytest/issues/5392) in 4.6.0 as a performance enhancement when pytest switched from `pkg_resources` to `importlib-metadata` for its own entrypoint handling.  This tripped up one of our test modules which defined classes that loaded templates from inside a test package.  Moving these resources to the parent package fixes the problem.

More and more, `pkg_resources` is being abandoned in favor of `importlib-metadata` and `importlib_resources` as they have a simpler design with much better performance.  However, `importlib_resources` doesn't support loading files from any directory which isn't itself a Python package (and doesn't allow direct use of paths including directories within the package).  Jinja2 chose a [different approach](https://github.com/pallets/jinja/pull/1082) that we may want to emulate in our resource handling.

Also fixed usage of a removed `pytest.raises()` parameter and a bug in our configuration of the `common/lib` tests that became a problem after the upgrade.
2019-12-30 09:10:57 -05:00
Awais Qureshi
928a84f969 BOM-1117
Specifying a namespace in django.conf.urls.include() without providing an app_name is deprecated.
Adding the app_name attribute in the included module.
2019-12-30 18:08:21 +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
Omar Al-Ithawi
99960d7001 Safer CourseOverview.org filed matching
Regular expressions are harder to read and debug
2019-12-30 11:01:50 +03:00
aarif
02350e0fee added on_delete parameter to foreign_key and oneToOne fields
changes made to fix issues with quality
2019-12-27 19:59:45 +05:00
Awais Qureshi
5f6b2db31b BOM-1111
Updating User.is_authenticated and User.is_anonymous as properties
2019-12-23 17:51:27 +05:00
Braden MacDonald
f31dc19887 Support anonymous users in the Blockstore-based XBlock runtime
Implementation details:
* Anonymous users are assigned a unique ID (like 
  `anon42c08f9996194e2a9339`) which gets stored in the django session.
  `block.scope_ids.user_id` and `block.runtime.anonymous_student_id`
  will both return this value.
* User state for anonymous users is stored in the django cache and
  automatically expires as the cache gets pruned. Because user state is
  stored, anonymous users can use interactive blocks like capa problems.
* There is no mechanism for upgrading to a registered account and
  keeping user state since the user state store for anonymous users
  (EphemeralKeyValueStore) is completely different than the one for
  registered users (DjangoKeyValueStore/"CSM"), and has no "list all
  keys" functionality.
* "User State Summary" field values are shared among [recently active]
  anonymous users but are not shared with registered users.
* Anonymous users can only access the `public_view` of XBlocks, not the
  regular `student_view`.
2019-12-19 16:12:24 -08:00
Calen Pennington
c83d0e2ca8 OverwriteStorage was removed from django-storages, so pull it into edx-platform (for now?) 2019-12-19 14:06:30 -05:00
David Ormsbee
a09c4e160b Merge pull request #22538 from open-craft/blockstore-video-transcripts
Support transcript files for video XBlocks in Blockstore
2019-12-19 11:24:27 -05:00
Hassan
92d585dd4a Merge pull request #22442 from edx/pwnage101/rename-creditrequirement-order-1
Rename order in CreditRequirement (1/3)
2019-12-19 21:00:21 +05:00
Troy Sankey
52eae381ac Rename order in CreditRequirement (1/3)
This stage does the following:

- Adds the new field and migration to create the column.
- Makes all* writes go to both old and new field.

(*) Except for writes from the Django Admin for this model.  I confirmed
with Support that CreditRequirements are never edited through the Django
Admin interface.  Additionally, I confirmed via the django_admin_log
that there is no record of anybody changing any CreditRequirements.
2019-12-19 15:42:46 +05:00
Hassan Javeed
b699308933 Added management command to add history from snapshot. 2019-12-19 15:41:29 +05:00
Aarif
10a00f8c98 Merge pull request #22508 from edx/BOM-1082
Updated the django-countries to support Django 2.2
2019-12-19 12:15:04 +05:00
Matthew Piatetsky
652b49c5ac Merge pull request #22550 from edx/REV-1064
[REV-1064] show discount in sidebar and sock
2019-12-18 14:08:22 -05:00
Jeremy Bowman
072b3c11a1 Upgrade edx-ace and edx-django-sites-extensions (#22535) 2019-12-18 14:07:20 -05:00
George Babey
aa111fbc66 Merge pull request #22472 from edx/hasnain-naveed/ENT-2505
ENT-2505 | By passing the check for forcing the login by third auth when user is…
2019-12-18 11:35:18 -05:00
Robert Raposa
44a6ca3c2f Merge pull request #22488 from edx/robrap/ARCH-1253-remove-login-shim-part-2
ARCH-1253: remove shim_student_view from LoginSession.post - Part 2
2019-12-18 08:54:38 -05:00
aarif
d81af828fb updated the django-countries to version that supports django 2.2
updated the tests

minor changes

changes made verify capitalized country code

changes made verify capitalized country code

changes made stay consistent with country code implementation

changes made to test with previous implementation

updated the django-countries version to latest

updated the tests input to match the output

updated the constants to use updated country names according to new ISO standards
2019-12-18 18:40:48 +05:00
Matthew Piatetsky
3a54df511a show discount in sidebar and sock 2019-12-17 09:09:19 -05:00
Usama Sadiq
3fb00a40e0 Merge pull request #22552 from edx/usama/prod-793-custom-backpopulate-credentials-arguments
Code fix & removed Pylint Warning Supression
2019-12-17 15:44:41 +05:00
usama sadiq
dc666127f1 Code fix & removed Pylint Warning 2019-12-17 15:01:30 +05:00
Robert Raposa
c5f44bf20e update READMEs to clarify responsibilities
Add some clarifications for student, user_api, and user_authn given
the recent clean-up of moving code to the appropriate apps.

ARCH-1248
2019-12-16 13:51:43 -05:00
Robert Raposa
b2be6b3ba2 Merge pull request #22513 from edx/robrap/ARCH-1253-login-user-post-only-take-3
ARCH-1253: require POST for login_user
2019-12-15 15:59:00 -05:00
Braden MacDonald
e4eac68e9f Support transcript files for video XBlocks in Blockstore 2019-12-15 12:35:03 -08:00
Robert Raposa
3505492fff require POST for login_user
ARCH-1253
2019-12-15 11:20:06 -05:00
Robert Raposa
f9613e8436 Merge pull request #22523 from edx/robrap/ARCH-1253-remove-DISABLE_DEPRECATED_LOGIN_POST
ARCH-1253: remove unused /login_post endpoint
2019-12-13 15:20:34 -05:00
usama sadiq
044a4899c5 Added custom arguments to the back-populate job
BackPopulate Program Credentials job performs data for all the programs
and for all the available learners which takes a lot of time.
Adding in custom arguments will help run this job for specific learners
and specific programs.
2019-12-13 19:34:53 +05:00
Robert Raposa
a9825889bf remove /login_post endpoint
- retires toggle DISABLE_DEPRECATED_LOGIN_POST
- permanently removes /login_post

Now that studio signin has been retired, we are able to remove the
unused /login_post endpoint.

ARCH-1253
2019-12-12 17:09:18 -05:00
Robert Raposa
e19c4eee8a use LoginSessionView.post for logistration
- retires toggle ENABLE_LOGIN_POST_WITHOUT_SHIM
- permanently points to LoginSessionView.post which no longer has shim

This is Part 2 of clean-up, and should be done once the toggle
is no longer required and the shim is no longer required.

ARCH-1253
2019-12-12 14:51:40 -05:00
Robert Raposa
d79e7df32b use login_ajax for logistration
- use login_ajax (in place of login_session with shim) for
logistration's call to login POST
- add toggle for using login_ajax from logistration
  - FEATURES['ENABLE_LOGIN_POST_WITHOUT_SHIM']
- add custom metrics for redirect_url
- update test for third-party auth error_code

NOTE: The error_code `third-party-auth-with-no-linked-account`
was introduced in JSON in this earlier PR:
https://github.com/edx/edx-platform/pull/22452/files

ARCH-1253
2019-12-12 10:39:49 -05:00
hunytalk
28d5458a1c Custom management command for data migration in Schedule 2019-12-12 00:02:59 +05:00
Nimisha Asthagiri
022a0117ae Merge pull request #22468 from edx/arch/account-activation-cleanup
Account Activation cleanup
2019-12-10 21:26:03 -05:00
Nimisha Asthagiri
f539a51901 user_authn: Move password-related tests to test_password.py 2019-12-10 20:23:52 -05:00
Nimisha Asthagiri
5e3df7aed4 user_api: Remove unneeded test-only activate_account 2019-12-10 20:23:52 -05:00
hasnain.naveed
ece5e48f1c ENT-2505 | By passing the check for forcing the login by third auth when user is already authenticated by third party. 2019-12-10 19:14:32 +05:00
David Ormsbee
f508ba3d01 Merge pull request #19941 from open-craft/jill/opt-out-weekly-highlight-messages
Add api support to let users opt out of email updates
2019-12-09 16:57:09 -05:00
Robert Raposa
06a0d3ff71 Merge pull request #22453 from edx/robrap/ARCH-1253-remove-UPDATE_LOGIN_USER_ERROR_STATUS_CODE
remove UPDATE_LOGIN_USER_ERROR_STATUS_CODE toggle
2019-12-09 14:16:57 -05:00
Feanil Patel
01b6b19f2e Merge pull request #22454 from edx/feanil/handle_pickling_failure
Feanil/handle pickling failure
2019-12-09 11:44:14 -05:00