Make sslLogin use getUserId

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
Patrick Uiterwijk 2017-05-03 21:16:20 +02:00 committed by Mike McLean
parent 5a23afaeeb
commit 7ec0e2c6b0

View file

@ -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: