Permalink
Browse files

Merge branch 'ABICLOUDPREMIUM-3643-edit_user_null_availableVDC' into …

…stable
  • Loading branch information...
2 parents 4aec2d3 + 63cd772 commit 870bf8dca0b88b6883047eee3cf92805b0b2af1f Vivien Mahe committed Apr 12, 2012
@@ -324,10 +324,14 @@ public User modifyUser(final Integer userId, final UserDto user)
}
old.setDescription(user.getDescription());
- if (!securityService.hasPrivilege(Privileges.USERS_PROHIBIT_VDC_RESTRICTION, old)
- && !StringUtils.isBlank(old.getAvailableVirtualDatacenters()))
+ if (!securityService.hasPrivilege(Privileges.USERS_PROHIBIT_VDC_RESTRICTION, old))
{
- user.setAvailableVirtualDatacenters(old.getAvailableVirtualDatacenters());
+ if (StringUtils.isBlank(user.getAvailableVirtualDatacenters()))
+ {
+ user.setAvailableVirtualDatacenters(null);
+ }
+
+ old.setAvailableVirtualDatacenters(user.getAvailableVirtualDatacenters());
}
if (!emailIsValid(user.getEmail()))
@@ -121,6 +121,9 @@ BEGIN
IF @existsCount = 0 THEN
INSERT INTO kinton.roles_privileges VALUES (1,53,0);
END IF;
+
+ -- Change to NULL to avoid an empty string for the property availableVirtualDatacenters --
+ UPDATE IGNORE user SET availableVirtualDatacenters = NULL WHERE availableVirtualDatacenters = "";
-- ######################################## --

0 comments on commit 870bf8d

Please sign in to comment.