From 17d57dbc7a6bcea5cbd2491f00b75af807f475c1 Mon Sep 17 00:00:00 2001 From: sgiannopoulos Date: Wed, 29 Nov 2023 17:49:00 +0200 Subject: [PATCH] bug fix --- .../main/java/eu/eudat/service/user/UserServiceImpl.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/user/UserServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/user/UserServiceImpl.java index 7d2456556..387d4abe8 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/user/UserServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/user/UserServiceImpl.java @@ -238,7 +238,7 @@ public class UserServiceImpl implements UserService { UserEntity data = this.entityManager.find(UserEntity.class, userId); - if (data == null) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{model.getId(), User.class.getSimpleName()}, LocaleContextHolder.getLocale())); + if (data == null) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{userId, User.class.getSimpleName()}, LocaleContextHolder.getLocale())); AdditionalInfoEntity additionalInfoEntity = this.jsonHandlingService.fromJsonSafe(AdditionalInfoEntity.class, data.getAdditionalInfo()); if (additionalInfoEntity == null) additionalInfoEntity = new AdditionalInfoEntity(); @@ -264,7 +264,7 @@ public class UserServiceImpl implements UserService { UserEntity data = this.entityManager.find(UserEntity.class, userId); - if (data == null) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{model.getId(), User.class.getSimpleName()}, LocaleContextHolder.getLocale())); + if (data == null) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{userId, User.class.getSimpleName()}, LocaleContextHolder.getLocale())); AdditionalInfoEntity additionalInfoEntity = this.jsonHandlingService.fromJsonSafe(AdditionalInfoEntity.class, data.getAdditionalInfo()); if (additionalInfoEntity == null) additionalInfoEntity = new AdditionalInfoEntity(); @@ -288,9 +288,8 @@ public class UserServiceImpl implements UserService { if (userId == null) throw new MyForbiddenException(this.errors.getForbidden().getCode(), this.errors.getForbidden().getMessage()); - UserEntity data = this.entityManager.find(UserEntity.class, userId); - if (data == null) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{model.getId(), User.class.getSimpleName()}, LocaleContextHolder.getLocale())); + if (data == null) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{userId, User.class.getSimpleName()}, LocaleContextHolder.getLocale())); AdditionalInfoEntity additionalInfoEntity = this.jsonHandlingService.fromJsonSafe(AdditionalInfoEntity.class, data.getAdditionalInfo()); if (additionalInfoEntity == null) additionalInfoEntity = new AdditionalInfoEntity();