Changeset 164


Ignore:
Timestamp:
Oct 9, 2007, 10:50:11 PM (17 years ago)
Author:
ecprice
Message:

fix invalid input exception, and let you "change" machine to it's own name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/templates/main.py

    r163 r164  
    3535    """
    3636    def __init__(self, err_field, err_value, expl=None):
    37         super(InvalidInput, self).__init__(expl)
     37        MyException.__init__(self, expl)
    3838        self.err_field = err_field
    3939        self.err_value = err_value
     
    586586    if Machine.select_by(name=name) == []:
    587587        return name
     588    if name == machine.name:
     589        return name
    588590    raise InvalidInput('name', name,
    589591                       "Already taken")
     
    611613        hostname = testHostname(owner, fields.getfirst('hostname'),
    612614                            machine)
    613         name = testName(user, fields.getfirst('name'))
     615        name = testName(user, fields.getfirst('name'), machine)
    614616        oldname = machine.name
    615617        olddisk = {}
     
    618620        if memory is not None:
    619621            memory = validMemory(user, memory, machine)
     622        else:
     623            memory = machine.memory
    620624        if memory != machine.memory:
    621625            machine.memory = memory
     
    624628        if disksize is not None:
    625629            disksize = validDisk(user, disksize, machine)
    626        
    627630        for disk in machine.disks:
    628631            disk.size = disksize
Note: See TracChangeset for help on using the changeset viewer.