Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #77

Merged
merged 2 commits into from
Jan 11, 2024
Merged

Dev #77

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion smartreport_app/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
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"\
'
4 changes: 2 additions & 2 deletions smartreport_app/kb_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'] = []

Expand Down
4 changes: 0 additions & 4 deletions smartreport_app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading