Fix a wrong return type from Base64Field.value_to_string().

Review Request #12538 — Created Aug. 15, 2022 and submitted — Latest diff uploaded

Information

Djblets
release-3.x

Reviewers

Base64Field.value_to_string() has been returning a byte string, but
this isn't actually compliant with what Django expects. This must return
a Unicode string. It's used for the serialization process, which doesn't
work with bytes on Python 3.

This switches the return type to use the correct string type.

Unit tests pass in Djblets and Review Board.

Succesfully serialized a database to JSON.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Fix a wrong return type from Base64Field.value_to_string().
`Base64Field.value_to_string()` has been returning a byte string, but this isn't actually compliant with what Django expects. This must return a Unicode string. It's used for the serialization process, which doesn't work with `bytes` on Python 3. This switches the return type to use the correct string type.
0b7465522acb6191e1ad776f1889dfea19fd92a2 Christian Hammond
djblets/db/fields/base64_field.py
djblets/db/tests/test_base64_field.py
Loading...