Skip to content

Commit

Permalink
some more refactoring for the neighbor plot in achievments view
Browse files Browse the repository at this point in the history
  • Loading branch information
joschobart committed Aug 25, 2024
1 parent eedde7d commit 2f263a8
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions fun_with_flags/achievements.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,12 @@ def achievements():
except Exception:
_scores.append(None)

if _scores[0] is None:
try:
_scores[-1] = _my_neighbor_doc["score"]["score"]
_scores[-2] = _my_neighbor_doc["score"]["score"]
except KeyError:
continue

if not "history" in _my_neighbor_doc["score"].keys():
_scores[-1] = _my_neighbor_doc["score"]["score"]
_scores[-2] = _my_neighbor_doc["score"]["score"]

if _scores[-1] is None:
try:
_scores[-1] = _my_neighbor_doc["score"]["score"]
except KeyError:
continue
_scores[-1] = _my_neighbor_doc["score"]["score"]

if _neighbor == g.user_id:
line_chart.add("You", _scores)
Expand Down

0 comments on commit 2f263a8

Please sign in to comment.