Coverage for formkit_ninja / management / commands / check_valid_names.py: 0.00%
13 statements
« prev ^ index » next coverage.py v7.13.1, created at 2026-03-06 04:12 +0000
« prev ^ index » next coverage.py v7.13.1, created at 2026-03-06 04:12 +0000
1from django.core.exceptions import ValidationError
2from django.core.management.base import BaseCommand
4from formkit_ninja.models import FormKitSchemaNode, check_valid_django_id
7class Command(BaseCommand):
8 help = "Check node 'name' fields to be valid python identifiers"
10 def handle(self, *args, **options):
11 for node in FormKitSchemaNode.objects.all():
12 if node.node and "name" in node.node:
13 name = node.node["name"]
14 try:
15 check_valid_django_id(name)
16 # self.stdout.write(self.style.SUCCESS(name))
17 except (TypeError, ValidationError):
18 self.stdout.write(self.style.WARNING(f"{node.pk}: {name}"))