Skip to content

Commit

Permalink
fix: fix instance typo when creating select field
Browse files Browse the repository at this point in the history
  • Loading branch information
mariajgrimaldi committed Nov 22, 2021
1 parent d056d6d commit d0328a9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions openedx/core/djangoapps/user_authn/views/registration_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,11 +699,11 @@ def _add_custom_field(self, form_desc, required=True, **kwargs):

# Check to convert options:
field_options = custom_field_dict.get("options")
if field_options:
if instance(field_options, dict):
field_options = [(str(value.lower()), name) for value, name in field_options.items()]
elif isinstance(field_options, list):
field_options = [(str(value.lower()), value) for value in field_options]

if isinstance(field_options, dict):
field_options = [(str(value.lower()), name) for value, name in field_options.items()]
elif isinstance(field_options, list):
field_options = [(str(value.lower()), value) for value in field_options]

# Set default option if applies:
default_option = custom_field_dict.get("default")
Expand Down

0 comments on commit d0328a9

Please sign in to comment.