def ship_delete(rec_id: int = None): if not current_user.is_authenticated: return redirect(url_for('login')) ship = Ship.query.get(rec_id) if not ship: abort(404) success, msg = delete_records(ship) flash(msg) return redirect(url_for('ship_view'))
def engine_delete(rec_id: int = None): if not current_user.is_authenticated: return redirect(url_for('login')) engine = Engine.query.get(rec_id) if not engine: abort(404) success, msg = delete_records(engine) flash(msg) return redirect(url_for('engine_view'))
def builder_delete(rec_id: int = None): if not current_user.is_authenticated: return redirect(url_for('login')) builder = Builder.query.get(rec_id) if not builder: abort(404) success, msg = delete_records(builder) flash(msg) return redirect(url_for('builder_view'))
def users_delete(rec_id: int = None): if current_user.is_authenticated and current_user.is_admin: user = User.query.get(rec_id) if not user: return success, msg = delete_records(user) flash(msg) return redirect(url_for('users_view')) else: return abort(403)