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)