Commit 1f9d2ed4 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

robotpkg management command: only look for */{slug} and */py-{slug}

parent 4f37c7ba
Pipeline #910 passed with stages
in 50 seconds
import itertools
import logging
from django.conf import settings
......@@ -20,7 +21,7 @@ class Command(BaseCommand):
for project in Project.objects.all():
for slug in [project.slug, project.slug.replace('_', '-')]:
for pkg in path.glob(f'*/*{slug}'):
for pkg in itertools.chain(path.glob(f'*/{slug}'), path.glob(f'*/py-{slug}')):
obj, created = Robotpkg.objects.get_or_create(name=pkg.name, category=pkg.parent.name,
project=project)
if created:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment