From 52898d932d9d8ba732212c737b4e5e768a1deecc Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Wed, 7 Feb 2024 15:08:06 -0800 Subject: [PATCH 1/2] Ensure facility id is properly sent to public signup viewset. --- kolibri/plugins/setup_wizard/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kolibri/plugins/setup_wizard/api.py b/kolibri/plugins/setup_wizard/api.py index 35c88bf21cb..16a77b8421e 100644 --- a/kolibri/plugins/setup_wizard/api.py +++ b/kolibri/plugins/setup_wizard/api.py @@ -51,7 +51,9 @@ def createuseronremote(self, request): url = "{}{}".format(baseurl, api_url) payload = { - "facility_id": facility_id, + # N.B. facility is keyed by facility not facility_id on the signup + # viewset serializer. + "facility": facility_id, "username": username, "password": password, "full_name": full_name, From e69794fac8a463c833d6de35220dd657313adb13 Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Thu, 8 Feb 2024 11:06:08 -0800 Subject: [PATCH 2/2] Use FACILITY_CREDENTIAL_KEY constant for consistency. --- kolibri/plugins/setup_wizard/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kolibri/plugins/setup_wizard/api.py b/kolibri/plugins/setup_wizard/api.py index 16a77b8421e..1fe6f1fa2d8 100644 --- a/kolibri/plugins/setup_wizard/api.py +++ b/kolibri/plugins/setup_wizard/api.py @@ -9,6 +9,7 @@ from rest_framework.response import Response from rest_framework.viewsets import ViewSet +from kolibri.core.auth.backends import FACILITY_CREDENTIAL_KEY from kolibri.core.auth.constants import user_kinds from kolibri.core.auth.models import Facility from kolibri.core.auth.models import FacilityUser @@ -53,7 +54,7 @@ def createuseronremote(self, request): payload = { # N.B. facility is keyed by facility not facility_id on the signup # viewset serializer. - "facility": facility_id, + FACILITY_CREDENTIAL_KEY: facility_id, "username": username, "password": password, "full_name": full_name,