eo_redmine: import sub-projects too (#83372)
gitea/barbacompta/pipeline/head There was a failure building this commit Details

This commit is contained in:
Pierre Ducroquet 2023-11-14 10:53:27 +01:00
parent 7f8e0f7a69
commit c3055e527a
1 changed files with 12 additions and 2 deletions

View File

@ -43,9 +43,13 @@ class Command(BaseCommand):
# Skip inactive or non-client projects
if project['status'] != 1:
continue
if not ('parent' in project) or project['parent']['name'] != 'Projets Clients':
if not ('parent' in project):
continue
if (
project['parent']['name'] != 'Projets Clients'
and project['parent']['id'] not in alive_projects
):
continue
alive_projects.append(project_id)
# get the members
cpf_ids = set()
@ -65,6 +69,12 @@ class Command(BaseCommand):
# missing user in barba, ignoring, will be fixed later once he is created
pass
# Require sub-projects to have a CPF defined
if len(cpfs) == 0 and project['parent']['name'] != 'Projets Clients':
continue
alive_projects.append(project_id)
# now match in our DB, maybe update
try:
project_object = Project.objects.get(id=project_id)