fetch user from database instead of using the one in the session to avoid hibernate exception

This commit is contained in:
Athou
2014-08-13 10:15:01 +02:00
parent 4e9266e2d5
commit 7b373c79d9

View File

@@ -325,7 +325,7 @@ public class UserREST {
if (CommaFeedApplication.USERNAME_ADMIN.equals(user.getName()) || CommaFeedApplication.USERNAME_DEMO.equals(user.getName())) {
return Response.status(Status.FORBIDDEN).build();
}
userService.unregister(user);
userService.unregister(userDAO.findById(user.getId()));
return Response.ok().build();
}
}