def handle(self, *app_labels, **options): if app_labels: app_configs = [apps.get_app_config(app_label) for app_label in app_labels] else: app_configs = None tags = options.get("tags", None) if tags and any(not checks.tag_exists(tag) for tag in tags): invalid_tag = next(tag for tag in tags if not checks.tag_exists(tag)) raise CommandError('There is no system check with the "%s" tag.' % invalid_tag) self.check(app_configs=app_configs, tags=tags, display_num_errors=True)
def handle(self, *app_labels, **options): include_deployment_checks = options['deploy'] if options.get('list_tags'): self.stdout.write('\n'.join(sorted(registry.tags_available(include_deployment_checks)))) return if app_labels: app_configs = [apps.get_app_config(app_label) for app_label in app_labels] else: app_configs = None tags = options.get('tags', None) if tags: try: invalid_tag = next( tag for tag in tags if not checks.tag_exists(tag, include_deployment_checks) ) except StopIteration: # no invalid tags pass else: raise CommandError('There is no system check with the "%s" tag.' % invalid_tag) self.check( app_configs=app_configs, tags=tags, display_num_errors=True, include_deployment_checks=include_deployment_checks, )
def handle(self, *app_labels, **options): include_deployment_checks = options['deploy'] if options['list_tags']: self.stdout.write('\n'.join( sorted(registry.tags_available(include_deployment_checks)))) return if app_labels: app_configs = [ apps.get_app_config(app_label) for app_label in app_labels ] else: app_configs = None tags = options['tags'] if tags: try: invalid_tag = next( tag for tag in tags if not checks.tag_exists(tag, include_deployment_checks)) except StopIteration: # no invalid tags pass else: raise CommandError( 'There is no system check with the "%s" tag.' % invalid_tag) self.check( app_configs=app_configs, tags=tags, display_num_errors=True, include_deployment_checks=include_deployment_checks, fail_level=getattr(checks, options['fail_level']), )
def handle(self, *app_labels, **options): if options.get("list_tags"): self.stdout.write("\n".join(sorted(registry.tags_available()))) return if app_labels: app_configs = [apps.get_app_config(app_label) for app_label in app_labels] else: app_configs = None tags = options.get("tags", None) if tags and any(not checks.tag_exists(tag) for tag in tags): invalid_tag = next(tag for tag in tags if not checks.tag_exists(tag)) raise CommandError('There is no system check with the "%s" tag.' % invalid_tag) self.check(app_configs=app_configs, tags=tags, display_num_errors=True)
def handle(self, *app_labels, **options): if app_labels: app_configs = [ apps.get_app_config(app_label) for app_label in app_labels ] else: app_configs = None tags = options.get('tags', None) if tags and any(not checks.tag_exists(tag) for tag in tags): invalid_tag = next(tag for tag in tags if not checks.tag_exists(tag)) raise CommandError('There is no system check with the "%s" tag.' % invalid_tag) self.check(app_configs=app_configs, tags=tags, display_num_errors=True)
def handle(self, *app_labels, **options): if options.get('list_tags'): self.stdout.write('\n'.join(sorted(registry.tags_available()))) return if app_labels: app_configs = [ apps.get_app_config(app_label) for app_label in app_labels ] else: app_configs = None tags = options.get('tags', None) if tags and any(not checks.tag_exists(tag) for tag in tags): invalid_tag = next(tag for tag in tags if not checks.tag_exists(tag)) raise CommandError('There is no system check with the "%s" tag.' % invalid_tag) self.check(app_configs=app_configs, tags=tags, display_num_errors=True)
def handle(self, *app_labels, **options): include_deployment_checks = options['deploy'] if options['list_tags']: self.stdout.write('\n'.join(sorted(registry.tags_available(include_deployment_checks)))) return if app_labels: app_configs = [apps.get_app_config(app_label) for app_label in app_labels] else: app_configs = None tags = options['tags'] if tags: try: invalid_tag = next( tag for tag in tags if not checks.tag_exists(tag, include_deployment_checks) ) except StopIterafrom django.apps import apps