Skip to content

Commit

Permalink
fix: problems in achievements.py
Browse files Browse the repository at this point in the history
  • Loading branch information
joschobart committed Sep 3, 2024
1 parent 419fa89 commit c2817dd
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions fun_with_flags/achievements.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ def achievements():
_mean_score = int(round(sum(_simple_score_list) / len(_simple_score_list), 0))
_median_score = int(round(median(_simple_score_list), 0))

_position = [x for x in _simple_score_set].index(g.fun_with_flags_score) + 1
_position = [x for x in _simple_score_list].index(g.fun_with_flags_score) + 1

print(_score_list, _simple_score_set)
print(_position, len(_simple_score_set))
print(_simple_score_list)
print(_position, len(_simple_score_list))



Expand Down Expand Up @@ -191,12 +191,10 @@ def achievements():
except KeyError:
if str(_badge) in _owned_badges:
_my_document["score"]["badges"][_badge] = str(datetime.utcnow())
finally:
try:
if (str(_badge) in _owned_badges) or _my_document["score"]["badges"][_badge]:
session["badges"][_badge] = _my_document["score"]["badges"][_badge].split(" ", 1)[0]
except KeyError:
pass
session["badges"][_badge] = _my_document["score"]["badges"][_badge].split(" ", 1)[0]
else:
session["badges"][_badge] = _my_document["score"]["badges"][_badge].split(" ", 1)[0]


_my_document["score"]["score"] = g.fun_with_flags_score
_my_document["score"]["history"][_weeknumber] = g.fun_with_flags_score
Expand All @@ -218,6 +216,10 @@ def achievements():
continue
_neighbors[_score_list[x][0]] = {}


print(_neighbors)


line_chart = pygal.Line()
line_chart.title = gettext("Your FwF Neighbors Score Evolution")

Expand Down

0 comments on commit c2817dd

Please sign in to comment.