Commit e19a0d19 authored by Maxym Borodenko's avatar Maxym Borodenko Committed by Matija Obreza
Browse files

Impossibility to save changes in the edited profile.

parent cee0257f
......@@ -224,7 +224,7 @@ public class UserProfileController extends BaseController {
@RequestMapping(value = "/{uuid:.+}/update", method = { RequestMethod.POST })
@PreAuthorize("hasRole('ADMINISTRATOR') || principal.uuid == #uuid")
public String update(ModelMap model, @PathVariable("uuid") String uuid, @RequestParam("name") String name,
public String update(ModelMap model, @PathVariable("uuid") String uuid, @RequestParam("fullName") String fullName,
@RequestParam("email") String email, @RequestParam(value = "currentPwd", required = false) String currentPwd,
@RequestParam(value = "pwd1", required = false) String pwd1, @RequestParam(value = "pwd2", required = false) String pwd2,
RedirectAttributes redirectAttributes) {
......@@ -234,7 +234,7 @@ public class UserProfileController extends BaseController {
}
try {
userService.updateUser(user, email, name);
userService.updateUser(user, email, fullName);
} catch (NotUniqueUserException e) {
redirectAttributes.addFlashAttribute("emailError", "User with e-mail address " + e.getEmail() + " already exists");
return "redirect:/profile/" + user.getUuid() + "/edit";
......
......@@ -18,9 +18,9 @@
<form role="form" class="form-horizontal validate" action="<c:url value="/profile/${user.uuid}/update" />" method="post">
<div class="form-group">
<label for="name" class="col-lg-2 control-label"><spring:message code="registration.full-name" /></label>
<label for="fullName" class="col-lg-2 control-label"><spring:message code="registration.full-name" /></label>
<div class="col-lg-3">
<form:input id="name" name="name" class="span3 form-control" path="user.fullName" />
<form:input id="fullName" name="fullName" class="span3 form-control" path="user.fullName" />
</div>
</div>
<div class="form-group">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment