-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Fixed #35920 -- Observed requires_system_checks in migrate and runserver. #18839
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
Conversation
pass | ||
|
||
class CustomRunserverCommand(RunserverCommand): | ||
"""Rather than mock run(), raise immediately after system checks run.""" |
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.
run()
calls inner_run()
, which calls check()
--which I didn't want to mock--and run()
, which I did, so I found this solution to most easily meet my needs. Open to alternatives, of course.
03145cd
to
ba66062
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.
You could most likely delegate tags
handling to super()
?
f40ddf8
to
1bf6152
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.
Thank you @jacobtylerwalls - this looks great!
Have a minor suggestion 👍
fbe9b61
to
84a24fd
Compare
…ver. Before, the full suite of system checks was run by these commands regardless if requires_system_checks had been overridden. Co-authored-by: Simon Charette <charette.s@gmail.com>
04ab9c9
to
75902d7
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.
Thank you @jacobtylerwalls
I pushed a small docs tweak 👍
@jacobtylerwalls If it's not too late, I think adding a bit more detail about the final design/solution would be helpful. The branch description has a "before" part in it but not "after". Also, it's hard to understand the effect of the PR and proposed solution (does it fix a bug, does it change the checks system, etc.) without reading the whole set of changes. |
Not too late by any means. Let me know how the new version looks? |
@jacobtylerwalls It looks perfect, thank you. |
Trac ticket number
ticket-35920
Branch description
Before, the full suite of system checks were run by these commands regardless if
requires_system_checks
had been overridden.Now, custom
migrate
andrunserver
observe the value ofrequires_system_checks
if overridden. That is, they only run the system checks tagged with the specified tags.As a consequence of the implementation:
requires_system_checks
for these commands now agree with the documentation. (Whereas before, in the migrate commandrequires_system_checks
was[]
even though system checks were being run.)get_check_kwargs()
allows for further customizing the behavior.Checklist
main
branch.