In database.py, inside the function load_IMEI_database_into_Redis, the current code appends the TAC CSV entries to tacList['tacList'] outside of the loop, causing only the last line in the CSV to be stored in Redis.
Proposed Fix:
Move the append statement inside the loop, so each line is added:
for line in csvfile:
# Remove unsafe characters from the CSV file
line = line.replace('"', '')
line = line.replace("'", '')
line = line.replace("\\", '')
line = line.rstrip()
result = line.split(',')
tacPrefix = result[0]
name = result[1].lstrip()
model = result[2].lstrip()
tacList['tacList'].append({str(tacPrefix): {'name': name, 'model': model}})
count += 1 ```