#26356: Allow management commands to require tagged checks
-------------------------------------+-------------------------------------
     Reporter:  julen                |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Core (Management     |                  Version:  master
  commands)                          |
     Severity:  Normal               |               Resolution:
     Keywords:  system checks        |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by julen):

 Thanks for the quick reply :)

 Yeah, I'm aware of `requires_system_checks`.

 Our use-case is that some of our system checks deal with existing DB data
 and they assume such data is there, however some other commands might be
 run before the DB is setup (`migrate`, and other related custom commands).
 For now we are catching potential exceptions in our checks' code, and
 hence it'd be sweet if we could just omit running such checks for certain
 commands in the first place as we have them tagged.

 We could override `BaseCommand.execute()` or `BaseCommand.check()`, but
 this feels clumsy and error-prone. On the other hand, `BaseCommand` could
 potentially read the tags to be checked from e.g.
 `BaseCommand.requires_system_check_tags` and this would be AFAICT roughly
 a single-line change in Django and our management commands.

--
Ticket URL: <https://code.djangoproject.com/ticket/26356#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.2a0690ae9c552983d7561074c83c3b7d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to