Skip to content

Commit 89072df

Browse files
author
Karan Goel
committed
trying to show the profile fields in the form
1 parent 9bc9b2e commit 89072df

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

warehouse/accounts/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def edit_profile(request, _form_class=forms.EditProfileForm):
6464

6565
user_service = request.find_service(IUserService, context=None)
6666
form = _form_class(request.POST, user_service=user_service)
67+
form.populate_obj(request.user)
6768

6869
return {"user": request.user, "form": form}
6970

warehouse/templates/accounts/edit.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
<form method="POST" action="{{ request.current_route_path() }}">
77
<input name="csrf_token" type="hidden" value="{{ request.session.get_csrf_token() }}">
88

9-
<p>{{user.username}}</p>
10-
119
<!-- Username -->
1210
{% if form.username.errors %}
1311
<ul class="errors">
@@ -42,6 +40,8 @@
4240
{% endif %}
4341
{{ form.password_confirm(placeholder="Confirm password") }}
4442

43+
<br>
44+
4545
<!-- Full name -->
4646
{% if form.full_name.errors %}
4747
<ul class="errors">

0 commit comments

Comments
 (0)