From 384cb4b1bd9a806fff885cfc0af2fc59f52db43e Mon Sep 17 00:00:00 2001 From: andrey-canon Date: Wed, 9 Aug 2023 19:09:04 -0500 Subject: [PATCH] fix: update certificates api_client data structure Previous structure was an outdated example, this implements the new structure and allow to set the metadata by settings --- eox_nelp/api_clients/certificates.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/eox_nelp/api_clients/certificates.py b/eox_nelp/api_clients/certificates.py index e2daa304..ff46bf14 100644 --- a/eox_nelp/api_clients/certificates.py +++ b/eox_nelp/api_clients/certificates.py @@ -62,10 +62,11 @@ def create_external_certificate(self, certificate_data): }, "group_code": certificate_data["group_code"], "certificate_type": "completion", # What types do we have ? - "metadata": { - "degree": certificate_data["grade"], - "FAIL": not certificate_data["is_passing"], - } + "score": { + "value": certificate_data["grade"], + "type": "percentage" + }, + "metadata": getattr(settings, "EXTERNAL_CERTIFICATES_METADATA", {}), } return self.make_post(path, payload)