From 56f93e7b9ea78ae5273bc1434903c51b9bada9de Mon Sep 17 00:00:00 2001 From: Julien Constant Date: Sat, 15 Apr 2023 14:41:17 +0200 Subject: [PATCH] Fix user tagged pictures section inside python rather than in the template --- core/templates/core/user_pictures.jinja | 2 +- core/views/user.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/templates/core/user_pictures.jinja b/core/templates/core/user_pictures.jinja index 2ed7b482..471aecda 100644 --- a/core/templates/core/user_pictures.jinja +++ b/core/templates/core/user_pictures.jinja @@ -13,7 +13,7 @@ {% if can_edit(profile, user) %} {% endif %} - {% for a in albums | unique %} + {% for a in albums %}

{{ a.name }}

{% for p in pictures[a.id] %} diff --git a/core/views/user.py b/core/views/user.py index f205a9d6..dbd60f13 100644 --- a/core/views/user.py +++ b/core/views/user.py @@ -321,7 +321,7 @@ class UserPicturesView(UserTabsMixin, CanViewMixin, DetailView): last_album = None for picture in picture_qs: album = picture.parent - if album.id != last_album: + if album.id != last_album and album not in kwargs["albums"]: kwargs["albums"].append(album) kwargs["pictures"][album.id] = [] last_album = album.id