From a6191a5b38bd285315c95526cfba8eb53472e1ac Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 21 Jun 2018 15:56:27 -0400 Subject: [PATCH] doorUpdater: Force consistent order of member levels --- doorUpdater.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doorUpdater.py b/doorUpdater.py index c3ec4da..f8204b7 100755 --- a/doorUpdater.py +++ b/doorUpdater.py @@ -2,6 +2,7 @@ import sys import requests import csv +from collections import OrderedDict from io import StringIO from hashlib import md5 import os @@ -77,7 +78,7 @@ def makeMember(member, doorAuth): if member[doorAuth] == "Y" \ and not member["Account on Hold"] == "Account on Hold": - levels = {k: v for k, v in memberLevels.items() if member[k] == k} + levels = OrderedDict(sorted([(k, v) for k, v in memberLevels.items() if member[k] == k])) out["Custom1"] = "|".join(levels.keys()).replace("&", "and") for index, schedule in enumerate(levels.values(), 1): #TODO: error if people have more than 8?