From: Evan Broder Date: Mon, 6 Oct 2008 08:36:05 +0000 (-0400) Subject: Fix a SQLAlchemyism in the web code X-Git-Tag: sipb-xen-www/3.14.4~3 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/commitdiff_plain/24bbf8e59bf6b9b0066a5db02cfbd2bb48f83a1f Fix a SQLAlchemyism in the web code svn path=/trunk/packages/sipb-xen-www/; revision=1074 --- diff --git a/code/controls.py b/code/controls.py index 013e04c..86c23c2 100644 --- a/code/controls.py +++ b/code/controls.py @@ -226,7 +226,7 @@ def commandResult(username, state, fields): machine = validation.Validate(username, state, machine_id=fields.getfirst('machine_id')).machine action = fields.getfirst('action') cdrom = fields.getfirst('cdrom') - if cdrom is not None and not CDROM.get(cdrom): + if cdrom is not None and not CDROM.query().filter_by(cdrom_id=cdrom).one(): raise CodeError("Invalid cdrom type '%s'" % cdrom) if action not in ('Reboot', 'Power on', 'Power off', 'Shutdown', 'Delete VM'):