1
1
mirror of https://github.com/encode/django-rest-framework.git synced 2025-04-27 20:43:46 +03:00

Move ret str check back to where it was

This commit is contained in:
Oliver Sauder 2025-01-08 20:54:11 +04:00
parent 1b5a84ab8b
commit 77a8015a32

View File

@ -189,9 +189,9 @@ class APIRequestFactory(DjangoRequestFactory):
content_type, renderer.charset
)
# Coerce text to bytes if required.
if isinstance(ret, str):
ret = ret.encode(renderer.charset)
# Coerce text to bytes if required.
if isinstance(ret, str):
ret = ret.encode(renderer.charset)
return ret, content_type