-
Notifications
You must be signed in to change notification settings - Fork 147
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
Type hints for class based views (and other tools) #2060
Type hints for class based views (and other tools) #2060
Conversation
92d4446
to
1477182
Compare
1477182
to
2606654
Compare
2606654
to
78037b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything else looks good to me
return not any(email.endswith("@" + domain) for domain in settings.INSTITUTION_EMAIL_DOMAINS) | ||
|
||
|
||
def sort_formset(request, formset): | ||
def sort_formset(request: HttpRequest, formset: BaseFormSet) -> None: | ||
if request.POST: # if not, there will be no cleaned_data and the models should already be sorted anyways | ||
formset.is_valid() # make sure all forms have cleaned_data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(not yours), but?
formset.is_valid() # make sure all forms have cleaned_data | |
assert formset.is_valid() # make sure all forms have cleaned_data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One test fails then. The method seems to be intended to also be callable with invalid formsets (via the default value in the line below).
Fixes #2055