Commit 86474e60 authored by Calum Mackervoy's avatar Calum Mackervoy Committed by Jean-Baptiste Pasquier

Configurable fields in Registration form

parent a7584d46
......@@ -59,6 +59,11 @@ EMAIL_HOST_PASSWORD = 'password'
Optionally you can configure which user fields which you would like to include on the registration form by including `REGISTRATION_FIELDS` in
REGISTRATION_FIELDS = ('username', 'email', 'password1', 'password2')
The workflow starts at :
Then, override template by copying the directory `djangoldp_account/templates/django_registration/` to your project and modify them.
......@@ -4,6 +4,13 @@ from django_registration.forms import RegistrationForm
from djangoldp_account.models import LDPUser
def _get_user_form_fields():
'''Gets the fields required for the form from settings, or returns default'''
from django.conf import settings
return getattr(settings, 'REGISTRATION_FIELDS', ('username', 'email', 'password1', 'password2'))
class LDPUserForm(RegistrationForm):
class Meta(RegistrationForm.Meta):
model = get_user_model()
fields = _get_user_form_fields()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment