diff --git a/server.py b/server.py index 23dac6c..b63382b 100644 --- a/server.py +++ b/server.py @@ -189,6 +189,9 @@ class Game(object): point_path = "{}/points".format(user.key) points = self.read_etcd(point_path, recursive=True) + if not points: + continue + for challenge in points.children: user_points[username] += int(challenge.value) @@ -217,7 +220,11 @@ https://code.ungleich.ch/nico/ungleich-game for k, v in point_list.items(): res.append("{} has {} points".format(k, v)) - return "\n".join(res) + return """ +Point list (aka high score) +--------------------------- +{} +""".format("\n".join(res)) def register(self): args = require_args("user")