]> git.parisson.com Git - teleforma.git/commitdiff
use period list
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 29 May 2023 22:53:01 +0000 (00:53 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 29 May 2023 22:53:01 +0000 (00:53 +0200)
teleforma/views/core.py

index a7b7a99b219c0331c3669bb6d79ab957a8b06400..1dc712748bd82302ee044d88e78cd5ab36aeba7a 100644 (file)
@@ -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)