Fixed stuff
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2020-04-22 00:50:40 +02:00
parent b0adf42de9
commit 265c7f6e85
2 changed files with 5 additions and 3 deletions

2
app.py
View File

@ -2,7 +2,7 @@ import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration from sentry_sdk.integrations.flask import FlaskIntegration
from flask import Flask from flask import Flask
import os import os
from rediscleint import redis_client from redisclient import redis_client
from endpoints import IPEndpoint from endpoints import IPEndpoint
""" """

View File

@ -1,6 +1,6 @@
import json import json
from redisclient import redis_client from redisclient import redis_client
from flask import jsonify from flask import jsonify, request, Response
from flask_classful import FlaskView from flask_classful import FlaskView
@ -9,5 +9,7 @@ class IPEndpoint(FlaskView):
def post(self): def post(self):
consumer = json.loads(redis_client.get('currentConsumer')) consumer = json.loads(redis_client.get('currentConsumer'))
consumer['Host'] = request.json['ip'] consumer['Host'] = request.json['ip']
strconsumer = json.dumps(consumer) strconsumer = json.dumps(consumer).encode('utf-8')
redis_client.set('currentConsumer', strconsumer) redis_client.set('currentConsumer', strconsumer)
return Response(status=204)