Commit 977655a1 by Aeolus

update

parent 11c217bb
......@@ -102,6 +102,7 @@ def run_add_machine():
"""
json_data = request.get_json()
machine_no = json_data["machine_no"]
if g.user.level != 1:
admin_machine = AdminMachine.query.filter_by(machine_no=machine_no, user_id=g.user.id, status=1).first()
if not admin_machine:
return jsonify(MACHINE_NOT_EXIST_ERROR)
......@@ -181,7 +182,7 @@ def run_edit_hatch():
hatch = Hatch.query.filter_by(id=hatch_id).first()
if not hatch:
return jsonify(HATCH_NOT_EXIST_ERROR)
if g.user.level != 1:
admin_machine = AdminMachine.query.filter_by(machine_no=hatch.machine_no, user_id=g.user.id, status=1).first()
if not admin_machine:
return jsonify(MACHINE_NOT_EXIST_ERROR)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment