# HG changeset patch # User Søren Løvborg # Date 2015-07-26 13:58:50 # Node ID 789c98a9306d83ca1e30a3c41219d0f7fbcdad44 # Parent b92c2e4324b0eeeb1c98e5064abb06e214140714 auth: remove username lookup support from AuthUser constructor The previous changeset means that there are no more callers using the `username` argument to AuthUser.__init__; it can be removed. diff --git a/kallithea/lib/auth.py b/kallithea/lib/auth.py --- a/kallithea/lib/auth.py +++ b/kallithea/lib/auth.py @@ -460,7 +460,7 @@ class AuthUser(object): but is also used as a generic user information data structure in parts of the code, e.g. user management. - Constructed from user ID, username, API key or cookie dict, it looks + Constructed from user ID, API key or cookie dict, it looks up the matching database `User` and copies all attributes to itself, adding various non-persistent data. If lookup fails but anonymous access to Kallithea is enabled, the default user is loaded instead. @@ -474,14 +474,14 @@ class AuthUser(object): However, `AuthUser` does refuse to load a user that is not `active`. """ - def __init__(self, user_id=None, api_key=None, username=None, + def __init__(self, user_id=None, api_key=None, is_external_auth=False): self.user_id = user_id self._api_key = api_key # API key passed as parameter self.api_key = None # API key set by user_model.fill_data - self.username = username + self.username = None self.name = '' self.lastname = '' self.email = '' @@ -515,10 +515,6 @@ class AuthUser(object): log.debug('Auth User lookup by API key %s' % self._api_key) is_user_loaded = user_model.fill_data(self, User.get_by_api_key(self._api_key)) - # lookup by username - elif self.username: - log.debug('Auth User lookup by USER NAME %s' % self.username) - is_user_loaded = user_model.fill_data(self, User.get_by_username(self.username)) else: log.debug('No data in %s that could been used to log in' % self)