diff --git a/app.py b/app.py index 28507b2..a2dcead 100644 --- a/app.py +++ b/app.py @@ -431,6 +431,14 @@ def missing(): cursor.close() conn.close() + color_file = np.loadtxt("colors.csv",delimiter=",",dtype="str") + + color_dict = {str(code): name for code, name, _, _ in color_file} + + for item in missing_list: + color_code = str(item[1]) + if color_code in color_dict: + item[1] = color_dict[color_code] return render_template('missing.html',missing_list=missing_list) @@ -445,7 +453,6 @@ def parts(): cursor.close() conn.close() - return render_template('parts.html',missing_list=missing_list) @app.route('/minifigs',methods=['POST','GET']) diff --git a/templates/missing.html b/templates/missing.html index 9aeabe0..9b8bf0d 100644 --- a/templates/missing.html +++ b/templates/missing.html @@ -102,7 +102,7 @@