contentful.py
contentful.py copied to clipboard
Embedded Asset in rich text field is not localized when using locale's wildcard
When I'm requesting Entry or building it with ResourceBuilder().build() I'm facing strange behavior -- embedded assets are not localized.
During debugging I've checked raw API response and I see correct asset's URLs are there, but seems like there is some sort of a bug.
Complete example how to reproduce the bug is bellow.
def foo():
client = contentful.Client(
"xyz",
"xyz",
default_locale="en-US",
api_url="preview.contentful.com",
)
entry = client.entry('qwerty12345', {"locale": "*"})
# here rich text field contains Portuguese text, but embedded Asset is for default language (en-US)
rich_text_field = entry.fields(locale='pt')['text']
Client version is contentful==1.13.1
Hi @mark-mishyn, thanks for reporting the issue. It has been a while since you reported the issue. Did you find the bug/problem or fix yet?
@rubydog I ended with fork and this ugly hot fix... but still use it in prod for almost a year:) https://github.com/contentful/contentful.py/commit/1a1e4f0f9b938590925fc4859fb7e89f31506437?diff=split