use json serialization
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
9c22b67627
commit
b0adf42de9
@ -1,3 +1,4 @@
|
|||||||
|
import json
|
||||||
from redisclient import redis_client
|
from redisclient import redis_client
|
||||||
from flask import jsonify
|
from flask import jsonify
|
||||||
from flask_classful import FlaskView
|
from flask_classful import FlaskView
|
||||||
@ -6,7 +7,7 @@ from flask_classful import FlaskView
|
|||||||
class IPEndpoint(FlaskView):
|
class IPEndpoint(FlaskView):
|
||||||
|
|
||||||
def post(self):
|
def post(self):
|
||||||
consumer = redis_client.get('currentConsumer')
|
consumer = json.loads(redis_client.get('currentConsumer'))
|
||||||
consumer['Host'] = request.json['ip']
|
consumer['Host'] = request.json['ip']
|
||||||
redis_client.set('currentConsumer', consumer)
|
strconsumer = json.dumps(consumer)
|
||||||
pass
|
redis_client.set('currentConsumer', strconsumer)
|
||||||
|
Reference in New Issue
Block a user