Changeset 5193 for MILK


Ignore:
Timestamp:
15/04/09 09:29:28 (10 years ago)
Author:
cbyrom
Message:

Fix issue with retaining parameters info when editing other info - need
to distinguish between case when all parameters are deleted and no
parameters are specified.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk_server/controllers/atom_editor/editatom.py

    r5175 r5193  
    208208            c.atom.addOnlineReferences(onlineRefs) 
    209209 
     210            # NB, if params have been specified, or removed, a list will be returned 
    210211            params = self.extractParameterDetails(self.inputs) 
    211212            # NB, the atom type and subtype are added to the categories when the 
    212213            # atom is exported to XML - so don't need to worry about overwriting 
    213214            # them now 
    214             c.atom.parameters = [] 
    215             c.atom.addParameters(params) 
     215            if params == []: 
     216                c.atom.parameters = [] 
     217            elif params: 
     218                c.atom.parameters = [] 
     219                c.atom.addParameters(params) 
    216220             
    217221            if self.inputs.get('subtype'): 
     
    230234             
    231235            # if a change of state has been specified,  
    232  
    233236            self.saveAtomToExist(c.atom, newState = newState) 
    234237        except Exception, e: 
     
    501504        @return: list of parameter data in triple string format - i.e. 
    502505        of format, 'label | scheme | term' 
     506        If no parameters are found, return None.  NB, if all params have been 
     507        removed, return [] 
    503508        ''' 
    504509        logging.info("Extracting parameters data from inputs") 
     
    531536                    continue 
    532537 
     538        if not processedParameters: 
     539            return None 
     540         
    533541        logging.info("Finished extracting parameters data") 
    534542        return parameters 
Note: See TracChangeset for help on using the changeset viewer.