Closes #3
Fixes issue with numeric identifiers not being handled as strings
This commit is contained in:
@@ -39,10 +39,10 @@ def get_identifier(name):
|
|||||||
conn = get_db_connection()
|
conn = get_db_connection()
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
for identifier in identifiers:
|
for identifier in identifiers:
|
||||||
c.execute('''SELECT identifier FROM brewers WHERE identifier=?''', (str(identifier),))
|
identifier = str(identifier)
|
||||||
|
c.execute('''SELECT identifier FROM brewers WHERE identifier=?''', (identifier,))
|
||||||
data = c.fetchone()
|
data = c.fetchone()
|
||||||
if data is None:
|
if data is None:
|
||||||
print("Assigning " + identifier + " to " + name)
|
|
||||||
c.execute("INSERT INTO brewers (name,identifier) VALUES(?, ?)", (name, identifier))
|
c.execute("INSERT INTO brewers (name,identifier) VALUES(?, ?)", (name, identifier))
|
||||||
conn.commit()
|
conn.commit()
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user