Project

General

Profile

« Previous | Next » 

Revision 5716

db_xml.py: put(): Inserting children with fkeys to parent: Don't do this if this node had an error and sql_io.put_table() returned None as the generated pkey. This fixes a bug where a node with an error will still try to create children with fkeys to parent, but pass None as the fkey to parent, which the recursive put() call will then incorrectly treat as there being no field with an fkey to parent at all rather than a field whose value is NULL. This causes function overload resolution to be unable to find the intended function, because it is missing a parameter.

View differences:

lib/db_xml.py
167 167
    
168 168
    # Insert children with fkeys to parent
169 169
    parent_ids_loc = pkeys_loc # applies to this section
170
    for child in children: put_(child)
170
    if parent_ids_loc != None: # not if this node had an error
171
        for child in children: put_(child)
171 172
    
172 173
    return pkeys_loc
173 174

  

Also available in: Unified diff