diff --git a/elekto/models/meta.py b/elekto/models/meta.py index 9c4a086..c812429 100644 --- a/elekto/models/meta.py +++ b/elekto/models/meta.py @@ -133,7 +133,9 @@ def results(self): return utils.parse_md(os.path.join(self.path, Election.RES)) def voters(self): - return utils.parse_yaml(os.path.join(self.path, Election.VOT)) + voters = utils.parse_yaml(os.path.join(self.path, Election.VOT)) + voters['eligible_voters'] = [voter.lower() for voter in voters['eligible_voters']] + return voters def showfields(self): return dict.fromkeys(self.election['show_candidate_fields'], '') diff --git a/elekto/utils.py b/elekto/utils.py index cf16ba8..5df1632 100644 --- a/elekto/utils.py +++ b/elekto/utils.py @@ -38,6 +38,7 @@ def set_session(app): # if unable to fetch the user's info, set auth to False if user and user.token_expires_at and user.token_expires_at > datetime.now(): F.g.user = user + F.g.user.username = F.g.user.username.lower() F.g.auth = True # Find all the user's past and all upcoming (meta only) elections query = SESSION.query(Election).join(