

@expose('/lab/golabreservation', methods=['POST'])
def change_go_lab_reservation(self):
    lab_id = int(request.form['lab_id'])
    activate = (request.form['activate'] == 'true')
    lab = self.session.query(Laboratory).filter_by(id=lab_id).first()
    if (lab is not None):
        if activate:
            lab.go_lab_reservation = (not activate)
        else:
            lab.go_lab_reservation = (not activate)
        self.session.add(lab)
        self.session.commit()
    return redirect(url_for('.index_view'))

dataset/ETHPy150Open gateway4labs/labmanager/labmanager/views/admin.py LaboratoryPanel.change_go_lab_reservation/original