From: Guillaume Pellerin Date: Mon, 29 May 2023 22:53:01 +0000 (+0200) Subject: use period list X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=87039217ecdeeeb6e41c9ba2e5685151f9414d35;p=teleforma.git use period list --- diff --git a/teleforma/views/core.py b/teleforma/views/core.py index a7b7a99b..1dc71274 100644 --- a/teleforma/views/core.py +++ b/teleforma/views/core.py @@ -216,11 +216,12 @@ class PeriodAccessMixin(View): for department in departments: url = 'https://' + department.domain + '/json/' s = ServiceProxy(url) - remote_list = s.teleforma.get_period_list(department.id) + remote_list = s.teleforma.get_period_list(department.name) + print(remote_list) if remote_list['result']: - for period_dict in remote_list['result']: + for period_name in remote_list['result']: period, c = Period.objects.get_or_create( - name=period_dict['name'], + name=period_name, department=department) periods_new.append(period) print(period)