Ticket #776: editUser.patch
| File editUser.patch, 1.0 kB (added by djazayeri, 8 months ago) |
|---|
-
/src/web/org/openmrs/web/controller/user/UserFormController.java
old new 132 132 Set<Role> newRoles = new HashSet<Role>(); 133 133 if (roles != null) { 134 134 for (String r : roles) { 135 Role role = us.getRole(r); 135 // Make sure that if we already have a detached instance of this role in the 136 // user's roles, that we don't fetch a second copy of that same role from 137 // the database, or else hibernate will throw a NonUniqueObjectException. 138 Role role = null; 139 for (Role test : user.getRoles()) 140 if (test.getRole().equals(r)) 141 role = test; 142 if (role == null) { 143 role = us.getRole(r); 144 user.addRole(role); 145 } 136 146 newRoles.add(role); 137 user.addRole(role);147 138 148 } 139 149 } 140 150
Download in other formats:
Powered by Trac 0.10.5
By Edgewall Software.
Visit the Trac open source project at
http://trac.edgewall.com/