add email to user profile form, so it can be updated by the user

cosmetic change to the profile view headings
This commit is contained in:
Thomas Waldmann 2013-10-31 23:41:44 +01:00
parent 7ccd293a3e
commit b5d036eb72
3 changed files with 3 additions and 4 deletions

View File

@ -7,4 +7,4 @@ from django.contrib.auth.models import User
class UserProfileForm(forms.ModelForm):
class Meta(object):
model = User
fields = ['first_name', 'last_name', ]
fields = ['first_name', 'last_name', 'email']

View File

@ -2,8 +2,7 @@
{% load bootstrap %}
{% block content %}
<h1>Hi, {{ request.user.username }}</h1>
<h3>Your data:</h3>
<h1>User Profile of {{ request.user.username }}</h1>
<div class="row">
<div class="col-lg-4">
<form method="post" action="">

View File

@ -9,7 +9,7 @@ from .forms import UserProfileForm
class UserProfileView(UpdateView):
template_name = "accounts/user_profile.html"
model = User
fields = ['first_name', 'last_name']
fields = ['first_name', 'last_name', 'email']
form_class = UserProfileForm
def get_object(self, queryset=None):