From e55b4fc3cafc5bfc61bbc798521bcade8f3bc24d Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Sun, 7 Jun 2020 13:29:27 +0200 Subject: [PATCH] loggin tp errors --- rowers/tpstuff.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rowers/tpstuff.py b/rowers/tpstuff.py index 49c6563e..d9d96996 100644 --- a/rowers/tpstuff.py +++ b/rowers/tpstuff.py @@ -72,6 +72,15 @@ def get_token(code): data=post_data,verify=False, ) + print(response.text) + + with open("media/tperrors.log","a") as errorlog: + timestr = strftime("%Y%m%d-%H%M%S") + errorlog.write(timestr+"\r\n") + json.dump(response.json(),errorlog) + errorlog.write("\r\n"+str(response.status_code)+' '+response.text) + errorlog.write("\r\n") + try: token_json = response.json()