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.
Specifying a namespace in django.conf.urls.include() without providing an app_name is deprecated.
Adding the app_name attribute in the included module.
The MockS3Mixin prevents the correct setup of the ModuleStoreTestCase
and made this test fail. Since the fix for this wasn't trivial, this
test was skipped on python 3, and now is removed.
A user's last logged in value previously wasn't updated when the user
logs in through the oauth2 flow from the ios mobile app. Here we must
send the user_logged_in signal manually. It's implemented in the
my_user_info mobile rest api endpoint because adding it to where the
oauth2 flow happens is to complex, and the mobile app hits this endpoint
after a successful login anyway.
https://github.com/boto/boto/issues/2868
In python 3 contentfile can act like a file but return unicode strings.
Boto doesn't like that and it causes issues when encoding the bytes for
transfer to s3.
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`.
When we run the management command, the photo_id_key is retrieved
through the orm and so is represented as a string. However, when we do
the initial attempt, the object is instantiated and we refer to the key
without having decoded it. The photo_id_key is sent as a part of the
request to software secure. And if we have a byte representation their
signature checking will fail.
This is why the management command worked even when the site didn't.
It was getting a cleaned key via the orm.
There were cases where we needed to encode things to codecs other than
ascii. In these cases, python returns byte strings but we needed them
to be unicode so that they serialize correctly later when we combine
them with other unicode strings.
This is Part 3 of clean-up for removing the shim from
LoginSessionView.post. Not that the shim should be gone, the frontend
code can be simplified to always provide the shimless version of the
code.
ARCH-1253
The mako engine isn't able to find themed templates in devstack because
the path it checks is set before we enable comprehensive theming. This
Adds a settings section to comment out if you want to enable
theming in devstack.
- 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