From b0adf42de92a7b9943f32708f7e77031d81fd502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Tue, 21 Apr 2020 22:55:39 +0200 Subject: [PATCH] use json serialization --- endpoints.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/endpoints.py b/endpoints.py index 1a990fe..966a587 100644 --- a/endpoints.py +++ b/endpoints.py @@ -1,3 +1,4 @@ +import json from redisclient import redis_client from flask import jsonify from flask_classful import FlaskView @@ -6,7 +7,7 @@ from flask_classful import FlaskView class IPEndpoint(FlaskView): def post(self): - consumer = redis_client.get('currentConsumer') + consumer = json.loads(redis_client.get('currentConsumer')) consumer['Host'] = request.json['ip'] - redis_client.set('currentConsumer', consumer) - pass + strconsumer = json.dumps(consumer) + redis_client.set('currentConsumer', strconsumer)