Skip to content
Permalink
Browse files

#1186 Fix user creation when user is invited

- Use latest (modified by InvitationService) user object to update the
user in UserService.create()
- Otherwise an exception is thrown, because the user object is outdated
(by the modifications of InvitationService) when updating it
  • Loading branch information
helkv committed Mar 4, 2020
1 parent 34d49a2 commit 57a7ce39f6dae04ae9a2141c89003b38108fc936
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/main/java/de/mpg/imeji/logic/security/user/UserService.java
@@ -111,7 +111,7 @@ public User create(User u, USER_TYPE type) throws ImejiException {
break;
}
u = controller.create(u);
new InvitationService().consume(u);
u = new InvitationService().consume(u);
try {
u.setApiKey(APIKeyAuthentication.generateKey(u.getId(), Integer.MAX_VALUE));
controller.update(u, Imeji.adminUser);

0 comments on commit 57a7ce3

Please sign in to comment.
You can’t perform that action at this time.