Commit 9c0b6a59 authored by Maxym Borodenko's avatar Maxym Borodenko Committed by Matija Obreza

Impossibility to change user password 2nd time.

parent 59af8623
Pipeline #2292 waiting for manual action with stages
in 6 minutes
......@@ -228,13 +228,13 @@ public class UserProfileController extends BaseController {
@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) {
final User user = userService.getUserByUuid(uuid);
User user = userService.getUserByUuid(uuid);
if (user == null) {
throw new ResourceNotFoundException();
}
try {
userService.updateUser(user, email, fullName);
user = 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";
......
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