Skip to content

Commit

Permalink
achievements unlocked needs to have 2 badges to not be a bit rubbish
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Dec 7, 2023
1 parent adeaadf commit df239d2
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions posthog/year_in_posthog/year_in_posthog.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,16 @@ def render_2023(request, user_uuid: str) -> HttpResponse:
badge = sort_list_based_on_preference(data.get("badges") or ["astronaut"])

badge_images = {}
for b in data.get("badges") or ["astronaut"]:
badge_images[b] = {
"badge": b,
"human_badge": human_badge.get(b),
"image_png": f"year_in_hog/badges/2023_{b}.png",
"image_webp": f"year_in_hog/badges/2023_{b}.webp",
"highlight_color": highlight_color.get(b),
"explanation": explanation.get(b),
}
for b in data.get("badges", {}):
if b != badge:
badge_images[b] = {
"badge": b,
"human_badge": human_badge.get(b),
"image_png": f"year_in_hog/badges/2023_{b}.png",
"image_webp": f"year_in_hog/badges/2023_{b}.webp",
"highlight_color": highlight_color.get(b),
"explanation": explanation.get(b),
}

stats = stats_for_badge(data, badge)

Expand Down

0 comments on commit df239d2

Please sign in to comment.