From bdf1c3c33827abe277f8ecbbc07de710a1f05c89 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 12 Jan 2023 14:57:32 +0300 Subject: Fix avatar update --- src/main/java/com/juick/www/controllers/Settings.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/juick/www/controllers') diff --git a/src/main/java/com/juick/www/controllers/Settings.java b/src/main/java/com/juick/www/controllers/Settings.java index 4d7deece..11371ced 100644 --- a/src/main/java/com/juick/www/controllers/Settings.java +++ b/src/main/java/com/juick/www/controllers/Settings.java @@ -92,7 +92,7 @@ public class Settings { @ModelAttribute User visitor, Locale locale, @RequestParam(required = false, defaultValue = "main") String page, - @RequestParam(required = false) String code, ModelMap model) throws IOException { + @RequestParam(required = false) String code, ModelMap model) { visitor.setAvatar(webApp.getAvatarWebPath(visitor)); List pages = Arrays.asList("main", "password", "about", "auth-email", "privacy"); if (!pages.contains(page)) { @@ -128,7 +128,7 @@ public class Settings { protected String doPost( @ModelAttribute User visitor, HttpServletRequest request, HttpServletResponse response, - @RequestParam(required = false) MultipartFile avatar, + @RequestParam(required = false) MultipartFile newAvatar, ModelMap model) throws IOException { if (visitor.isAnonymous()) { @@ -166,7 +166,7 @@ public class Settings { visitor.setCountry(request.getParameter("country")); visitor.setUrl(request.getParameter("url")); visitor.setDescription(request.getParameter("descr")); - String avatarTmpPath = HttpUtils.receiveMultiPartFile(avatar, storageService.getTemporaryDirectory()).getHost(); + String avatarTmpPath = HttpUtils.receiveMultiPartFile(newAvatar, storageService.getTemporaryDirectory()).getHost(); if (StringUtils.isNotEmpty(avatarTmpPath)) { storageService.saveAvatar(avatarTmpPath, visitor); } -- cgit v1.2.3