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

Fix room constrainee ID dropdown #1723

Closed
wants to merge 1 commit into from

Conversation

czlee
Copy link
Member

@czlee czlee commented Jan 24, 2021

Fixes #1722.

@tienne-B can you think of any cleaner ways to do this?

Also, I wanted to add a simple regression test just to check the label of the field, so that if a package change bites us like this again, we'll know straight away rather than only when it's reported by a user. But I couldn't find any off-the-shelf tests suitable for checking the label of a field, and it's complicated by how the formset and form in question aren't classes in their own right; they're constructed by factories in the view. We could check the HTML output directly, but that's messy, and the value attribute of the <option> element is database-dependent (since it's the ID of the content type). I guess this is mostly a frontend function (the labels aren't, but the dropdown filtering is), so it's not really cut out for testing by the Django testing tools. The other idea would be to include a unit test for the JavaScript in venues/templates/venue_constraints_edit.html, @philipbelesky is there any (easy) scope for this?

(If adding a test is too hard then we should just merge without it, I just wanted to get takes on the idea first, since this seems like the kind of thing regression testing is for.)

@czlee czlee added the bugs Reported/reproduced bugs label Jan 24, 2021
@czlee czlee added this to the Hotfixes milestone Jan 24, 2021
Comment on lines -1 to -9
from django.forms import TextInput


class SelectPrepopulated(TextInput):
template_name = 'select_prepopulated_widget.html'

def __init__(self, data_list, *args, **kwargs):
super(SelectPrepopulated, self).__init__(*args, **kwargs)
self.data_list = data_list
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know why this file was still here lol

@czlee czlee linked an issue Feb 15, 2021 that may be closed by this pull request
@tienne-B tienne-B closed this Mar 7, 2021
@tienne-B tienne-B deleted the branch hotfix/2.5.7 March 7, 2021 17:27
@tienne-B tienne-B deleted the bug/room-constrainee-dropdown branch March 7, 2021 21:33
@tienne-B
Copy link
Member

tienne-B commented Mar 7, 2021

Merged in 186c81b

czlee added a commit that referenced this pull request Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs Reported/reproduced bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Room constrainee ID dropdown doesn't list options
2 participants