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.
Quality / encoding
Remove comments
remove debug
Changed service implementation to make unit testing easier
Corrected service
code style
unit test cleanup
Clean up imports
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.
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.
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.
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