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:
parent
7ccd293a3e
commit
b5d036eb72
@ -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']
|
||||
|
@ -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="">
|
||||
|
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user