} catch (Throwable t) {\r
if (originalUser != null) {\r
// restore original user\r
- users.put(originalUser.username, originalUser);\r
+ users.put(originalUser.username.toLowerCase(), originalUser);\r
+ } else {\r
+ // drop attempted add\r
+ users.remove(model.username.toLowerCase());\r
}\r
logger.error(MessageFormat.format("Failed to update user model {0}!", model.username),\r
t);\r
} catch (Throwable t) {\r
if (original != null) {\r
// restore original team\r
- teams.put(original.name, original);\r
+ teams.put(original.name.toLowerCase(), original);\r
+ } else {\r
+ // drop attempted add\r
+ teams.remove(model.name.toLowerCase());\r
}\r
logger.error(MessageFormat.format("Failed to update team model {0}!", model.name), t);\r
}\r