Changeset - 9d4fa3689996
[Not reviewed]
default
0 1 0
Dennis Fink - 11 years ago 2014-01-24 00:18:21
dennis.fink@c3l.lu
whitespace
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
ennstatus/api/views.py
Show inline comments
 
@@ -29,25 +29,25 @@ def update():
 
        return str(e), 409, {'Content-Type': 'text/plain'}
 

	
 
    if 'ip' in json:
 
        ip = json['ip']
 
    else:
 
        ip = request.remote_addr
 

	
 
    if request.remote_addr not in accepted_ips:
 
        current_app.logger.warn("Unallowed IP %s tried to update data!"
 
                                % ip)
 
        return 'IP not allowed!\n', 403, {'Content-Type': 'text/plain'}
 

	
 
    current_app.logger.info(str(json))    
 
    current_app.logger.info(str(json))
 
    server = update_server(server=json, ip=ip)
 

	
 
    if server:
 
        current_app.logger.info('Return result')
 
        current_app.logger.info(str(server))
 
        return (jsonify(server), 201,
 
                {'Location': '/api/export/json/single?server_name=%s'
 
                 % server['server_name']})
 

	
 
    else:
 
        current_app.logger.error("Unexpected error: %s" % server,
 
                                 exc_info=True)
0 comments (0 inline, 0 general)