Skip to content

Conversation

@mariajgrimaldi
Copy link
Contributor

This PR adds a new format for registration field options, it allows us to use:

Format 1:

"options": [option1, ...., optionN]

Format 2:

"options": {"value": "name", ..., "valueN": "nameN"}

if field_options:
field_options = [(six.text_type(option.lower()), option) for option in field_options]
try:
field_options = [(six.text_type(value.lower()), name) for value, name in field_options.items()]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I think that we should try first the old format (field_options = [(six.text_type(value.lower()), value) for value in field_options]) and if that fails use the new format. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But how the old format would fail? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. My bad😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants