From 011a58f6b39c52354019b2bfbdb5c7bb1408a594 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Fri, 25 Dec 2020 14:29:38 +0100 Subject: [PATCH] Use thumbnail in profile_update. --- .../lostplaces/templates/explorer/profile_update.html | 5 +++-- django_lostplaces/lostplaces/views/explorer_views.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/django_lostplaces/lostplaces/templates/explorer/profile_update.html b/django_lostplaces/lostplaces/templates/explorer/profile_update.html index d852031..9db8eca 100644 --- a/django_lostplaces/lostplaces/templates/explorer/profile_update.html +++ b/django_lostplaces/lostplaces/templates/explorer/profile_update.html @@ -1,5 +1,6 @@ {% extends 'global.html'%} {% load i18n %} +{% load thumbnail %} {% load widget_tweaks %} # {% block title %}{% trans 'Edit Explorer profile' %}{% endblock %} @@ -34,9 +35,9 @@
- {% if explorer_image_url %} + {% if explorer_image %}
- +
{% endif %}
diff --git a/django_lostplaces/lostplaces/views/explorer_views.py b/django_lostplaces/lostplaces/views/explorer_views.py index 5e0a134..9d9ca3d 100644 --- a/django_lostplaces/lostplaces/views/explorer_views.py +++ b/django_lostplaces/lostplaces/views/explorer_views.py @@ -52,7 +52,7 @@ class ExplorerProfileUpdateView(IsAuthenticatedMixin, View): 'explorer_change_form': ExplorerChangeForm(instance=request.user.explorer) } 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) def post(self, request, *args, **kwargs):