Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft content is returned from entries #58

Closed
rpastorelle opened this issue Jun 24, 2020 · 2 comments · Fixed by #59
Closed

Draft content is returned from entries #58

rpastorelle opened this issue Jun 24, 2020 · 2 comments · Fixed by #59

Comments

@rpastorelle
Copy link

rpastorelle commented Jun 24, 2020

Consider the following:

  • ModelA contains optional link to resource of type ModelB
  • nyancat is of type ModelA and contains DRAFT content of type ModelB

Screen Shot 2020-06-24 at 5 11 59 PM

When we fetch the content, we get some metadata in return:

res = client.entries({"content_type": "nyancat"})
content = res[0]
print content.signup

We see this output in reference to the draft content:

{u'sys': {u'linkType': u'Entry', u'type': u'Link', u'id': u'75fmVQxvWvm4UqCOyMR163'}}

For published content, I'd except to see:

<Entry[modelB] id='Xx9XxXnxx9xX99X9xxX9x9'>

Since draft content is not published, this should operate as if the content does not exist.


Draft content should not be returned from the Content Delivery API

Ref: https://www.contentful.com/developers/docs/tutorials/general/determine-entry-asset-state/

content.signup should be omitted altogether since it's in draft state

The problem this causes for me is that there is no way to determine if I should use fallback data.

My check for if content and content.fields().get("signup") should fail allowing me to properly set a default value.
However:

  • content.fields().get('signup') exists
  • and content.signup.fields() does not (since signup is a dict here)
@dlitvakb
Copy link
Contributor

dlitvakb commented Jul 8, 2020

Hey @rpastorelle,

Thanks for letting us know about this issue, I've talked with one of our backend engineers about the topic and he requested if you could open a ticket in https://support.contentful.com

On the ticket please provide your Space ID, and you can use this Github issue as a reference.

Cheers

@rpastorelle
Copy link
Author

@dlitvakb Thanks, I submitted a ticket with support 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants