aboutsummaryrefslogtreecommitdiff
path: root/apps/accounts/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'apps/accounts/forms.py')
-rw-r--r--apps/accounts/forms.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/accounts/forms.py b/apps/accounts/forms.py
new file mode 100644
index 0000000..d53e754
--- /dev/null
+++ b/apps/accounts/forms.py
@@ -0,0 +1,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)