From 480166230b32a97a1571af03efe983c291829f0f Mon Sep 17 00:00:00 2001 From: matteotolloso Date: Sat, 6 Jan 2024 23:12:58 +0100 Subject: [PATCH 1/2] sms --- smartreport_app/email.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/smartreport_app/email.py b/smartreport_app/email.py index dc54f6c..3ec6514 100644 --- a/smartreport_app/email.py +++ b/smartreport_app/email.py @@ -143,4 +143,18 @@ def mail_final_presentation(): img.add_header('Content-ID', '<{name}>'.format(name=image)) img.add_header('Content-Disposition', 'inline', filename=image) msg.attach(img) - print(msg.send(fail_silently=False)) \ No newline at end of file + print(msg.send(fail_silently=False)) + + +def send_sms(): + command = '\ + curl -X POST \ + -H "Authorization: Bearer 6ece5154b6e446c1a11f798da819e5ab"\ + -H "Content-Type: application/json" -d "\ + {\ + "from": "447520652538",\ + "to": [ " " ],\ + "body": "Enter test message here"\ + }"\ + "https://sms.api.sinch.com/xms/v1/fe0559cd9a074aec9cd5947b64ab91c9/batches"\ + ' \ No newline at end of file From 1135109aaa6ab133ea80430f97c325fbd425a110 Mon Sep 17 00:00:00 2001 From: matteotolloso Date: Thu, 11 Jan 2024 17:29:08 +0100 Subject: [PATCH 2/2] predict is optional for lineplot --- smartreport_app/kb_interface.py | 4 ++-- smartreport_app/views.py | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/smartreport_app/kb_interface.py b/smartreport_app/kb_interface.py index 8228d12..7a96327 100644 --- a/smartreport_app/kb_interface.py +++ b/smartreport_app/kb_interface.py @@ -109,13 +109,13 @@ def kb_interface(params): dataset['fill'] = False dataset['borderColor'] = colors[i%len(colors)] dataset['backgroundColor'] = transp_colors[i%len(colors)] - dataset['tension'] = 0 + dataset['tension'] = 0.6 if predict: dashed_dataset = {} dashed_dataset['fill'] = False dashed_dataset['borderColor'] = colors[i%len(colors)] dashed_dataset['backgroundColor'] = transp_colors[i%len(colors)] - dashed_dataset['tension'] = 0.8 + dashed_dataset['tension'] = 0 dashed_dataset['label'] = kb_resp['name'] + ' ' +'Prediction' dashed_dataset['data'] = [] diff --git a/smartreport_app/views.py b/smartreport_app/views.py index 6a7e9d7..8b3ab96 100644 --- a/smartreport_app/views.py +++ b/smartreport_app/views.py @@ -127,10 +127,6 @@ def list(self, request): if 'chart_type' not in params: return Response({"message": "The required parameter 'chart_type' is missing"}, status=status.HTTP_400_BAD_REQUEST) - # TODO remove after testing - if params["chart_type"] == 'line': - params['predict'] = True - if list_of_KB_uids == []: return Response({"message": "No kpis found"}, status=status.HTTP_400_BAD_REQUEST)