PEP8 Fixes
This commit is contained in:
parent
23d2adba3c
commit
829fb05801
@ -46,11 +46,13 @@ login_manager.login_view = 'login'
|
||||
def hello():
|
||||
return render_template("index.html")
|
||||
|
||||
|
||||
@app.route("/events")
|
||||
@login.login_required
|
||||
def events():
|
||||
return render_template("events.html")
|
||||
|
||||
|
||||
@app.route("/agents", methods=["GET", "POST"])
|
||||
@login.login_required
|
||||
def agents():
|
||||
@ -82,6 +84,7 @@ def agents():
|
||||
else:
|
||||
return render_template("agents.html")
|
||||
|
||||
|
||||
#
|
||||
# Login forms
|
||||
#
|
||||
|
@ -26,6 +26,7 @@ api = Blueprint('api', __name__, url_prefix="/api")
|
||||
def root():
|
||||
return jsonify(hello='World')
|
||||
|
||||
|
||||
@api.route('/<int:tenant_id>/', methods=['GET', 'POST'])
|
||||
def tenant(tenant_id):
|
||||
if request.method == 'POST':
|
||||
@ -37,8 +38,6 @@ def tenant(tenant_id):
|
||||
return jsonify(tenant.as_dict()), 201
|
||||
else:
|
||||
return jsonify(tenant.as_dict())
|
||||
|
||||
|
||||
else:
|
||||
tenant = Tenant.query.filter_by(id=tenant_id).first()
|
||||
if tenant is None:
|
||||
@ -46,6 +45,7 @@ def tenant(tenant_id):
|
||||
else:
|
||||
return jsonify(tenant.as_dict())
|
||||
|
||||
|
||||
@api.route('/<int:tenant_id>/policies/', methods=['GET', 'POST'])
|
||||
def policies(tenant_id):
|
||||
if request.method == 'POST':
|
||||
@ -96,7 +96,6 @@ def agents(tenant_id):
|
||||
return Response(json.dumps(agents_dicts, cls=DateTimeJsonEncoder), mimetype='application/json')
|
||||
|
||||
|
||||
|
||||
@api.route('/<int:tenant_id>/logs/', methods=['GET', 'POST'])
|
||||
def logs(tenant_id):
|
||||
if request.method == 'POST':
|
||||
@ -124,6 +123,7 @@ def logs(tenant_id):
|
||||
events_dicts = map(Event.as_dict, events.all())
|
||||
return Response(json.dumps(events_dicts, cls=DateTimeJsonEncoder), mimetype='application/json')
|
||||
|
||||
|
||||
@api.route('/alllogs/', methods=['GET'])
|
||||
def alllogs(timestamp=None):
|
||||
events = Event.query.order_by(Event.received_on)
|
||||
@ -138,6 +138,7 @@ def alllogs(timestamp=None):
|
||||
}'''
|
||||
return Response(json_str, mimetype='application/json')
|
||||
|
||||
|
||||
@api.route('/allagents/', methods=['GET'])
|
||||
def allagents(timestamp=None):
|
||||
agents = Agent.query.order_by(Agent.id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user