From 82c73e66c74181ea7679fd633f8a66c2c156cbe6 Mon Sep 17 00:00:00 2001 From: Michael Romashov Date: Thu, 29 Apr 2021 09:35:36 -0400 Subject: [PATCH] Forgot to update this to the new VATUSA API format. --- apps/training/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/training/views.py b/apps/training/views.py index f2d1afc..fc58c9f 100644 --- a/apps/training/views.py +++ b/apps/training/views.py @@ -88,8 +88,8 @@ def post_ctrs(session): else: response = requests.post(f'https://api.vatusa.net/v2/user/{session.student.cid}/training/record', data=data) - if response.json()['status'] == 'OK': - session.ctrs_id = response.json()['id'] + if response.json().get('data').get('status') == 'OK': + session.ctrs_id = response.json().get('data').get('id') session.save()