Compare commits

..

4 Commits

3 changed files with 8 additions and 3 deletions

View File

@ -27,7 +27,7 @@ def generate_profile_image_filename(instance, filename):
Returns filename as: explorer_pk-username.jpg
"""
return 'explorers/' + str(instance.explorer.pk) + '-' + str(instance.explorer.username) + '.' + filename.split('.')[-1]
return 'explorers/' + str(instance.user.pk) + '-' + str(instance.user.username) + '.' + filename.split('.')[-1]
class Explorer(models.Model):
"""

View File

@ -14,6 +14,12 @@
</div>
<div class="LP-UserInfo__Meta">
<table>
<tr>
{% if explorer.profile_image %}
<figure class="LP-UserInfo__Image">
<img src="{{ explorer.profile_image.url }}" class="LP-Image" />
</figure>
{% endif %}
<tr>
<td class="LP-UserInfo__Key">
<span class="LP-Paragraph">{% trans 'Name' %}</span>
@ -64,7 +70,7 @@
<div class="LP-PlaceList">
<h1 class="LP-Headline">{% trans 'Favorite places' %}</h1>
<ul class="LP-PlaceList__List">
{% for place in favorite_places %}
{% for place in explorer.favorite_places.all %}
<li class="LP-PlaceList__Item">
{% include 'partials/place_teaser.html' with place=place extended=True %}
</li>

View File

@ -23,7 +23,6 @@ class ExplorerProfileView(IsAuthenticatedMixin, View):
'explorer': explorer,
'place_count': place_count,
'place_list': place_list,
'favorite_places': explorer.favorite_places.all(),
'assets': {}
}