eo_redmine: ne pas prendre les CPF backup (#83270)

This commit is contained in:
Pierre Ducroquet 2023-11-09 11:25:52 +01:00
parent f07bc69eba
commit 955cfeaa15
1 changed files with 4 additions and 4 deletions

View File

@ -55,7 +55,7 @@ class Command(BaseCommand):
if not 'user' in membership:
continue
for role in membership['roles']:
if role['name'] in ('CPF', 'CPF (Backup)'):
if role['name'] == 'CPF':
cpf_ids.add(membership['user']['id'])
cpfs = []
for cpf_id in cpf_ids:
@ -66,17 +66,17 @@ class Command(BaseCommand):
pass
# now match in our DB, maybe update
insert = False
try:
project_object = Project.objects.get(id=project_id)
except Project.DoesNotExist:
project_object = Project()
project_object.id = project_id
insert = True
project_object.name = project_name
project_object.save()
project_object.name = project_name
project_object.cpfs.set(cpfs)
project_object.save(force_insert=insert)
project_object.save()
# Purge dead projects
Project.objects.exclude(id__in=alive_projects).delete()