Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As a developer, I need to be able to add a default value to an integer enum section but have it overridable #3485

Open
kitsuta opened this issue Aug 5, 2019 · 3 comments

Comments

@kitsuta
Copy link
Member

kitsuta commented Aug 5, 2019

It turns out that #3470 introduced a bug where, if your event doesn't have any configured options under [[staff_event_shirts]], you will not be able to add any attendees to the database.

Obviously this is a problem, but the other problem is that we use the text in the options under [[staff_event_shirts]], and due to the implementation of integer enums those options' text can't be changed. So if I set a default of, say, "No Event Shirts" = string(default="0"), and add a config option called Two Staff Shirts = 0, I will have c.STAFF_EVENT_SHIRT_OPTS be populated with [(0, 'Two Staff Shirts'), (0, 'No Event Shirts')]

This is not ideal.

@jmdawson
Copy link
Contributor

I implemented that change on the MFF staging server but got the same sort of error.

[integer_enums]
[[shirt]]
"Small" = 1
"Medium" = 2
"Large" = 3
"Extra Large" = 4
"2X Large" = 5
"3X Large" = 6
"4X Large" = 7
"5X Large" = 8

[[staff_event_shirts]]
"No event shirts" = 0

[[fee_price]]
'Badge Replacement' = 20

@kitsuta
Copy link
Member Author

kitsuta commented Aug 11, 2019

Update: we found later that I had actually written [[staff_event_shirt]] in the singular. This was correct, since that's the style of other sections (otherwise you'd get variable names like c.SHIRTS_OPTS), but then later I forgot. Whoops!

@jmdawson
Copy link
Contributor

Confirmed that sorted it.

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

No branches or pull requests

2 participants