X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/de08100bad0d82b2823453ecccaa66fd7521cd41..e7d557155e2cd195f975e4559c353be5f28d7d66:/src/wolnelektury/forms.py?ds=sidebyside diff --git a/src/wolnelektury/forms.py b/src/wolnelektury/forms.py new file mode 100644 index 000000000..0973e7d93 --- /dev/null +++ b/src/wolnelektury/forms.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +from django.contrib.auth.forms import UserCreationForm +from django.contrib.auth.models import User + +from newsletter.forms import NewsletterForm + + +# has to be this order, because otherwise the form is lacking fields +class RegistrationForm(UserCreationForm, NewsletterForm): + class Meta: + model = User + fields = ('username', 'email') + + def save(self, commit=True): + super(RegistrationForm, self).save(commit=commit) + NewsletterForm.save(self)