+ if rv[0].get("deadline") < datetime.now() or rv[0].get("canceled") is not None:
+ return "Error, out of time", 403
+ return id
+
+
+@app.route("/motion/<string:motion>/cancel", methods=['POST'])
+def cancel_motion(motion):
+ id = validate_access([motion, request.host, 'cancel'])
+ if not isinstance(id, int):
+ return id[0], id[1]