Skip to content

[#ZC-2889]: when the server returns a 201 with a payload, update the …#87

Closed
percious wants to merge 3 commits into
masterfrom
ZC-2889-support-201-payload-update-on-create
Closed

[#ZC-2889]: when the server returns a 201 with a payload, update the …#87
percious wants to merge 3 commits into
masterfrom
ZC-2889-support-201-payload-update-on-create

Conversation

@percious

Copy link
Copy Markdown
Contributor

…entity with the information.

@percious percious requested a review from jjdelc March 13, 2026 20:24
Comment thread src/pycrunch/shoji.py
else:
# We have a progress_url, wait for completion
entity.wait_progress(r, progress_tracker)
elif r.status_code == 201 and r.payload and "body" in r.payload:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our API the 201 responses do not have a body. They are an empty body and Location header. This condition will never be True in our use.

if r.status_code == 201:
  entity.refresh()  # This should work because the `self` was set above. Triggers the correct GET request.

@percious percious closed this Mar 16, 2026
@percious percious deleted the ZC-2889-support-201-payload-update-on-create branch March 16, 2026 16:46
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 this pull request may close these issues.

2 participants