Changeset 2707


Ignore:
Timestamp:
Dec 20, 2009, 9:46:43 PM (15 years ago)
Author:
broder
Message:

main.py: FieldStorage? is history, so revert to sugared getitem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • package_branches/invirt-web/cherrypy-rebased/code/main.py

    r2706 r2707  
    200200
    201201    def parseCreate(self, fields):
    202         kws = dict([(kw, fields.get(kw)) for kw in
     202        kws = dict([(kw, fields[kw]) for kw in
    203203         'name description owner memory disksize vmtype cdrom autoinstall'.split()
    204                     if fields.get(kw)])
     204                    if fields[kw]])
    205205        validate = validation.Validate(cherrypy.request.login,
    206206                                       cherrypy.request.state,
     
    230230        d['err'] = err
    231231        if err:
    232             for field in fields.keys():
    233                 setattr(d['defaults'], field, fields.get(field))
     232            for field, value in fields.items():
     233                setattr(d['defaults'], field, value))
    234234        else:
    235235            d['new_machine'] = parsed_fields['name']
     
    295295            info_dict['err'] = err
    296296            if err:
    297                 for field in fields.keys():
    298                     setattr(info_dict['defaults'], field, fields.get(field))
     297                for field, value in fields.items():
     298                    setattr(info_dict['defaults'], field, value)
    299299            info_dict['result'] = result
    300300            return info_dict
     
    528528    session.begin()
    529529    try:
    530         kws = dict([(kw, fields.get(kw)) for kw in
     530        kws = dict([(kw, fields[kw]) for kw in
    531531         'owner admin contact name description memory vmtype disksize'.split()
    532                     if fields.get(kw)])
     532                    if fields[kw]])
    533533        kws['machine_id'] = machine_id
    534534        validate = validation.Validate(username, state, **kws)
Note: See TracChangeset for help on using the changeset viewer.