From: Guillaume Pellerin Date: Tue, 7 Mar 2023 14:40:12 +0000 (+0100) Subject: add get_course_type_list rpc method X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=cc2e0c955e251f2abc5bd21ca2dfecead53c0192;p=teleforma.git add get_course_type_list rpc method --- diff --git a/teleforma/views/core.py b/teleforma/views/core.py index d245e157..12bc0070 100644 --- a/teleforma/views/core.py +++ b/teleforma/views/core.py @@ -456,6 +456,10 @@ class CourseListView(CourseAccessMixin, ListView): department = Department.objects.get(id=id) return [{'id': str(c.id), 'name': unicode(c)} for c in department.period.all()] + @jsonrpc_method('teleforma.get_course_type_list') + def get_course_type_list(request): + return [course_type.to_dict() for course_type in CourseType.objects.all()] + class CourseView(CourseAccessMixin, DetailView):