From b5d036eb72c5f0705378ff0ebd431457c778f9a4 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Thu, 31 Oct 2013 23:41:44 +0100 Subject: [PATCH] add email to user profile form, so it can be updated by the user cosmetic change to the profile view headings --- nsupdate/accounts/forms.py | 2 +- nsupdate/accounts/templates/accounts/user_profile.html | 3 +-- nsupdate/accounts/views.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/nsupdate/accounts/forms.py b/nsupdate/accounts/forms.py index f1803bf..1e5c031 100644 --- a/nsupdate/accounts/forms.py +++ b/nsupdate/accounts/forms.py @@ -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'] diff --git a/nsupdate/accounts/templates/accounts/user_profile.html b/nsupdate/accounts/templates/accounts/user_profile.html index 774ab56..c65599e 100644 --- a/nsupdate/accounts/templates/accounts/user_profile.html +++ b/nsupdate/accounts/templates/accounts/user_profile.html @@ -2,8 +2,7 @@ {% load bootstrap %} {% block content %} -

Hi, {{ request.user.username }}

-

Your data:

+

User Profile of {{ request.user.username }}

diff --git a/nsupdate/accounts/views.py b/nsupdate/accounts/views.py index 0bd328e..14d3716 100644 --- a/nsupdate/accounts/views.py +++ b/nsupdate/accounts/views.py @@ -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):