Commits

Casey Greene  committed c289fd6

update RegistrationForm

  • Participants
  • Parent commits 27bccd1

Comments (0)

Files changed (1)

File registration/forms.py

 from django import forms
 from django.utils.translation import ugettext_lazy as _
 
+from crispy_forms.helper import FormHelper
+from crispy_forms.layout import Submit
 
 # I put this on all required fields, because it's easier to pick up
 # on them with CSS or JavaScript if they have a class of "required"
                                 label=_("Password"))
     password2 = forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict, render_value=False),
                                 label=_("Password (again)"))
-    
+
+    def __init__(self, *args, **kwargs):
+        self.helper = FormHelper()
+        self.helper.form_method = 'post'
+        self.helper.form_action = 'registration_register'
+
+        self.helper.add_input(Submit('submit', 'Submit'))
+        super(RegistrationForm, self).__init__(*args, **kwargs)
+
     def clean_username(self):
         """
         Validate that the username is alphanumeric and is not already