Imoh Rufus Anthony
Imoh Rufus Anthony

Reputation: 106

How to overwrite django-redux default user registration form

When the default django-registration-redux registration page loads, it displays fields for username, email, password, along with labels instructing the user on minimum xters for username, and a list of instructions on setting password. I want to be able to add some fields to the form, also, I want to remove the list of instruction labels. I could do it with JS but how do i overwrite the class from the django-registration-redux. Pls i really need help. I have tried subclassing different classes, yet no headway.

Upvotes: 0

Views: 193

Answers (1)

user7104029
user7104029

Reputation:

You can remove help text with the below code. In your app forms.py, write below code: from registration.forms import RegistrationForm

    class MyRegForm(RegistrationForm):
        def __init__(self,*args,**kwargs):

            for fieldname in ['username','email', 'password1', 'password2']:
                self.fields[fieldname].help_text = None
                self.fields[fieldname].labels = None

Upvotes: 0

Related Questions