merge error indentation fix
This commit is contained in:
parent
f54da25d2b
commit
1de35b2f01
|
@ -1412,11 +1412,11 @@ def recognisePlayerIDs(cursor, names, site_id):
|
|||
ids = dict(cursor.fetchall()) # convert to dict
|
||||
if len(ids) != len(names):
|
||||
notfound = [n for n in names if n not in ids] # make list of names not in database
|
||||
if notfound: # insert them into database
|
||||
cursor.executemany("INSERT INTO Players (name, siteId) VALUES (%s, "+str(site_id)+")", (notfound))
|
||||
q2 = "SELECT name,id FROM Players WHERE name=%s" % " OR name=".join(["%s" for n in notfound])
|
||||
cursor.execute(q2, notfound) # get their new ids
|
||||
tmp = dict(cursor.fetchall())
|
||||
if notfound: # insert them into database
|
||||
cursor.executemany("INSERT INTO Players (name, siteId) VALUES (%s, "+str(site_id)+")", (notfound))
|
||||
q2 = "SELECT name,id FROM Players WHERE name=%s" % " OR name=".join(["%s" for n in notfound])
|
||||
cursor.execute(q2, notfound) # get their new ids
|
||||
tmp = dict(cursor.fetchall())
|
||||
for n in tmp: # put them all into the same dict
|
||||
ids[n] = tmp[n]
|
||||
# return them in the SAME ORDER that they came in in the names argument, rather than the order they came out of the DB
|
||||
|
|
Loading…
Reference in New Issue
Block a user