# HG changeset patch # User Robert James Dennington # Date 2016-01-15 15:55:27 # Node ID dba6c44f0a3097fd7833d9b68aae73e85051b61d # Parent 18c9eb22c29cf06969f2bc886efc096a861a2e6a auth: Fix bug where usernames are not consistently capitalized when using crowd login If you try to log in to Kallithea via the Crowd auth module then the capitalization of your username in Kallithea changes on every login based on how you capitalized it in the login form. E.g. Log in with "TestDude", username is entered as "TestDude" then log in again, but this time as "tesTduDe", and your username gets changed to "tesTduDe". etc. Fix for this is to use the 'name' field returned from Crowd when saving the username. This way the username is always capitalized identically to the record in Crowd. diff --git a/kallithea/lib/auth_modules/auth_crowd.py b/kallithea/lib/auth_modules/auth_crowd.py --- a/kallithea/lib/auth_modules/auth_crowd.py +++ b/kallithea/lib/auth_modules/auth_crowd.py @@ -222,7 +222,7 @@ class KallitheaAuthPlugin(auth_modules.K lastname = getattr(userobj, 'lastname', '') user_data = { - 'username': username, + 'username': crowd_user["name"] or username, 'firstname': crowd_user["first-name"] or firstname, 'lastname': crowd_user["last-name"] or lastname, 'groups': crowd_user["groups"],