Use thumbnail in profile_update.

This commit is contained in:
Marcus Scholz 2020-12-25 14:29:38 +01:00
parent 67ce6cb50b
commit 011a58f6b3
2 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,6 @@
{% extends 'global.html'%} {% extends 'global.html'%}
{% load i18n %} {% load i18n %}
{% load thumbnail %}
{% load widget_tweaks %} {% load widget_tweaks %}
# {% block title %}{% trans 'Edit Explorer profile' %}{% endblock %} # {% block title %}{% trans 'Edit Explorer profile' %}{% endblock %}
@ -34,9 +35,9 @@
</div> </div>
<div class="LP-Form__Composition"> <div class="LP-Form__Composition">
{% if explorer_image_url %} {% if explorer_image %}
<div class="LP-Form__Field"> <div class="LP-Form__Field">
<img class="LP-Form__Field LP-Image" src="{{ explorer_image_url }}"/> <img src="{% thumbnail explorer_image 200x200 %}"/>
</div> </div>
{% endif %} {% endif %}
<div class="LP-Form__Field"> <div class="LP-Form__Field">

View File

@ -52,7 +52,7 @@ class ExplorerProfileUpdateView(IsAuthenticatedMixin, View):
'explorer_change_form': ExplorerChangeForm(instance=request.user.explorer) 'explorer_change_form': ExplorerChangeForm(instance=request.user.explorer)
} }
if request.user.explorer.profile_image: if request.user.explorer.profile_image:
context['explorer_image_url'] = request.user.explorer.profile_image.url context['explorer_image'] = request.user.explorer.profile_image
return render(request, 'explorer/profile_update.html', context) return render(request, 'explorer/profile_update.html', context)
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):