Skip to content

Commit

Permalink
204 NO CONTENT regression fix (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-Andre-Rivet authored May 10, 2019
1 parent e2a1707 commit 4744414
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Fixed
- Fix regression on handling PreventUpdate (204 NO CONTENT) [#170](https://github.com/plotly/dash-renderer/pull/170)

## [0.23.0] - 2019-04-25
### Fixed
- Fix regression for `children=0` case [#148](https://github.com/plotly/dash-renderer/issues/148)
Expand Down
11 changes: 8 additions & 3 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,13 +674,18 @@ function updateOutput(
// update the status of this request
updateRequestQueue(true, res.status);

/*
* This is a 204 response code, there's no content to process.
*/
if (res.status === STATUS.PREVENT_UPDATE) {
return;
}

/*
* eject into `catch` handler below to display error
* message in ui
*/
if (res.status !== STATUS.PREVENT_UPDATE) {
throw res;
}
throw res;
}

/*
Expand Down
2 changes: 1 addition & 1 deletion tests/test_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def update_input(value):
'lxml').select_one('#output > div').contents

self.assertTrue(
pad_input.attrs == {'id': 'sub-input-1', 'value': 'sub input initial value'}
pad_input.attrs == {'type': 'text', 'id': 'sub-input-1', 'value': 'sub input initial value'}
and pad_input.name == 'input',
"pad input is correctly rendered")

Expand Down

0 comments on commit 4744414

Please sign in to comment.