Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions openedx/core/djangoapps/user_authn/views/registration_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@


import copy
from collections import OrderedDict
from importlib import import_module
import logging
import re
Expand Down Expand Up @@ -364,16 +365,14 @@ def __init__(self):
@property
def EXTRA_FIELDS(self):
"""eduNEXT: Property that returns extra fields list plus extended profile fields. This
property allows us to add custom fields to the registration form using extended_profile_fields.
property allows us to add custom fields to the registration form using extended_profile_fields and
REGISTRATION_EXTRA_FIELDS.
"""
extended_profile_fields = getattr(settings, 'extended_profile_fields', [])
extra_fields = list(configuration_helpers.get_value('REGISTRATION_EXTRA_FIELDS', {}).keys())

# In case there's duplicates
if set(self.EXTRA_FIELDS_BASE) != set(extended_profile_fields):
difference = set(extended_profile_fields).difference(set(self.EXTRA_FIELDS_BASE))
return self.EXTRA_FIELDS_BASE + list(difference)

return self.EXTRA_FIELDS_BASE + extended_profile_fields
# Removing duplicates while mantaining order, important when running tests.
return list(OrderedDict.fromkeys(self.EXTRA_FIELDS_BASE + extended_profile_fields + extra_fields))

def get_registration_form(self, request):
"""Return a description of the registration form.
Expand Down