diff options
author | James Moger <james.moger@gitblit.com> | 2012-08-06 17:39:25 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2012-08-06 17:39:25 -0400 |
commit | 65f55e2a2cdbce33ed4d2d7111b49ff00b2fd575 (patch) | |
tree | 12e69508e159a75fa32bebd036db4158fd717764 /src | |
parent | 2987f602e112d37ff7db522c3cd9e653847a9865 (diff) | |
download | gitblit-65f55e2a2cdbce33ed4d2d7111b49ff00b2fd575.tar.gz gitblit-65f55e2a2cdbce33ed4d2d7111b49ff00b2fd575.zip |
Drop failed attempt to add user or team (issue 118)
Diffstat (limited to 'src')
-rw-r--r-- | src/com/gitblit/ConfigUserService.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/com/gitblit/ConfigUserService.java b/src/com/gitblit/ConfigUserService.java index 959c1bca..faad6915 100644 --- a/src/com/gitblit/ConfigUserService.java +++ b/src/com/gitblit/ConfigUserService.java @@ -315,7 +315,10 @@ public class ConfigUserService implements IUserService { } catch (Throwable t) {
if (originalUser != null) {
// restore original user
- users.put(originalUser.username, originalUser);
+ users.put(originalUser.username.toLowerCase(), originalUser);
+ } else {
+ // drop attempted add
+ users.remove(model.username.toLowerCase());
}
logger.error(MessageFormat.format("Failed to update user model {0}!", model.username),
t);
@@ -514,7 +517,10 @@ public class ConfigUserService implements IUserService { } catch (Throwable t) {
if (original != null) {
// restore original team
- teams.put(original.name, original);
+ teams.put(original.name.toLowerCase(), original);
+ } else {
+ // drop attempted add
+ teams.remove(model.name.toLowerCase());
}
logger.error(MessageFormat.format("Failed to update team model {0}!", model.name), t);
}
|