mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 14:13:21 +00:00
Fix user picture view with Jinja update
This commit is contained in:
parent
d3514e85f4
commit
5897318cc6
@ -5,27 +5,19 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% set album = None %}
|
||||
{% set new_album = True %}
|
||||
{% for r in profile.pictures.exclude(picture=None).order_by('-picture__parent__id', 'id') -%}
|
||||
{%- if album != r.picture.parent %}
|
||||
{%- if album %}
|
||||
</div>
|
||||
{% endif -%}
|
||||
{% set new_album = True %}
|
||||
{% set album = r.picture.parent %}
|
||||
{% set picture_qs = profile.pictures.exclude(picture=None).order_by('-picture__parent__id', 'id').select_related('picture__parent__parent__name') %}
|
||||
{% for a in picture_qs.distinct('picture__parent') %}
|
||||
<div style="padding: 10px">
|
||||
<h4>{{ album.name }}</h4>
|
||||
<h4>{{ a.picture.parent.name }}</h4>
|
||||
<hr>
|
||||
{% else %}
|
||||
{% set new_album = False %}
|
||||
{%- endif %}
|
||||
{% for r in picture_qs.filter(picture__parent=a.picture.parent) -%}
|
||||
<div class="picture">
|
||||
<a href="{{ url("sas:picture", picture_id=r.picture.id) }}#pict">
|
||||
<img src="{{ r.picture.get_download_thumb_url() }}" alt="{{ r.picture.get_display_name() }}" style="max-width: 100%"/>
|
||||
</a>
|
||||
</div>
|
||||
{%- endfor %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -502,8 +502,8 @@ class UserAccountView(UserAccountBase):
|
||||
(lambda q: q.amount)
|
||||
)
|
||||
kwargs['etickets'] = self.object.customer.buyings.exclude(product__eticket=None).all()
|
||||
except:
|
||||
pass
|
||||
except Exception as e:
|
||||
print(repr(e))
|
||||
return kwargs
|
||||
|
||||
class UserAccountDetailView(UserAccountBase, YearMixin, MonthMixin):
|
||||
|
Loading…
Reference in New Issue
Block a user