Skip to content
Snippets Groups Projects
Commit 61be1bac authored by Kristof Neirynck's avatar Kristof Neirynck Committed by Dave Syer
Browse files

Fix #207 set pet owner when for has an error

parent ca2a6650
No related branches found
No related tags found
No related merge requests found
......@@ -103,6 +103,7 @@ class PetController {
@RequestMapping(value = "/pets/{petId}/edit", method = RequestMethod.POST)
public String processUpdateForm(@Valid Pet pet, BindingResult result, Owner owner, ModelMap model) {
if (result.hasErrors()) {
pet.setOwner(owner);
model.put("pet", pet);
return VIEWS_PETS_CREATE_OR_UPDATE_FORM;
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment