blob: d53e75474472a077ea0ee10eefd8da33e4c31984 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
from django import forms
from django_registration.forms import RegistrationForm
from .models import User, UserProfile
class UserForm(RegistrationForm):
class Meta(RegistrationForm.Meta):
model = User
class ProfileForm(forms.ModelForm):
class Meta:
model = UserProfile
fields = '__all__'
def __init__(self, *args, **kwargs):
self.user = kwargs.pop("user", None)
super(ProfileForm, self).__init__(*args, **kwargs)
|