Make sslLogin use getUserId
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
parent
5a23afaeeb
commit
7ec0e2c6b0
1 changed files with 2 additions and 8 deletions
10
koji/auth.py
10
koji/auth.py
|
|
@ -401,14 +401,8 @@ class Session(object):
|
|||
else:
|
||||
raise koji.AuthError('%s is not authorized to login other users' % client_dn)
|
||||
|
||||
cursor = context.cnx.cursor()
|
||||
query = """SELECT id FROM users
|
||||
WHERE name = %(username)s"""
|
||||
cursor.execute(query, locals())
|
||||
result = cursor.fetchone()
|
||||
if result:
|
||||
user_id = result[0]
|
||||
else:
|
||||
user_id = self.getUserId(username)
|
||||
if not user_id:
|
||||
if context.opts.get('LoginCreatesUser'):
|
||||
user_id = self.createUser(username)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue