Ticket #11590: LabelCommand_default_label.diff

File LabelCommand_default_label.diff, 692 bytes (added by maaku, 15 years ago)

patch against SVN

  • django/core/management/base.py

     
    312312    """
    313313    args = '<label label ...>'
    314314    label = 'label'
     315    default_label = None
    315316
    316317    def handle(self, *labels, **options):
    317318        if not labels:
    318             raise CommandError('Enter at least one %s.' % self.label)
     319            if not self.default_label:
     320                raise CommandError('Enter at least one %s.' % self.label)
     321            else:
     322                labels = [self.default_label]
    319323
    320324        output = []
    321325        for label in labels:
Back to Top