Skip to content

Instantly share code, notes, and snippets.

@ajamaica
Created February 2, 2012 04:05
Show Gist options
  • Save ajamaica/1721374 to your computer and use it in GitHub Desktop.
Save ajamaica/1721374 to your computer and use it in GitHub Desktop.
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class UserCreationFormExtended(UserCreationForm):
def __init__(self, *args, **kwargs):
super(UserCreationFormExtended, self).__init__(*args,
**kwargs)
self.fields['email'].required = True
self.fields['first_name'].required = True
self.fields['last_name'].required = True
class Meta:
model = User
fields = ('username', 'email', 'first_name', 'last_name')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment