fix: 🤦 fix profile view bug
This commit is contained in:
parent
6c9a647141
commit
7d00dfe7be
2 changed files with 6 additions and 6 deletions
|
|
@ -3,22 +3,22 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="grid-content">
|
<div class="grid-content">
|
||||||
<aside class="profile">
|
<aside class="profile">
|
||||||
<h2>@{{ user.username }}</h2>
|
<h2>@{{ profile.username }}</h2>
|
||||||
<dl>
|
<dl>
|
||||||
<div>
|
<div>
|
||||||
<dt>{% trans %}pronouns{% endtrans %}</dt>
|
<dt>{% trans %}pronouns{% endtrans %}</dt>
|
||||||
<dd>{{ user.pronouns or "not set" }}</dd>
|
<dd>{{ profile.pronouns or "not set" }}</dd>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<dt>{% trans %}location{% endtrans %}</dt>
|
<dt>{% trans %}location{% endtrans %}</dt>
|
||||||
<dd>{{ user.location or "not set" }}</dd>
|
<dd>{{ profile.location or "not set" }}</dd>
|
||||||
</div>
|
</div>
|
||||||
<div class="double">
|
<div class="double">
|
||||||
<dt>{% trans %}about me{% endtrans %}</dt>
|
<dt>{% trans %}about me{% endtrans %}</dt>
|
||||||
<dd>{{ user.bio or "not set" }}</dd>
|
<dd>{{ profile.bio or "not set" }}</dd>
|
||||||
</div>
|
</div>
|
||||||
</dl>
|
</dl>
|
||||||
{% if user.id == request.user.id %}
|
{% if profile.id == request.user.id %}
|
||||||
<p class="mt"><a href="{{ url('profile.edit') }}">{% trans %}edit{% endtrans %}</a></p>
|
<p class="mt"><a href="{{ url('profile.edit') }}">{% trans %}edit{% endtrans %}</a></p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</aside>
|
</aside>
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ class ProfileView(TemplateView):
|
||||||
user = User.objects.get(username=self.kwargs.get("username"))
|
user = User.objects.get(username=self.kwargs.get("username"))
|
||||||
return {
|
return {
|
||||||
**super().get_context_data(**kwargs),
|
**super().get_context_data(**kwargs),
|
||||||
"user": user,
|
"profile": user,
|
||||||
"posts": user.posts.order_by("-created_at").all(),
|
"posts": user.posts.order_by("-created_at").all(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue