Ticket #5031: kwargsPop.diff

File kwargsPop.diff, 931 bytes (added by zigiDev@…, 17 years ago)

Patch

  • base.py

     
    136136                        # Assume object instance was passed in.
    137137                        rel_obj = kwargs.pop(field.name)
    138138                    except KeyError:
    139                         try:
    140                             # Object instance wasn't passed in -- must be an ID.
    141                             val = kwargs.pop(field.attname)
    142                         except KeyError:
    143                             val = field.get_default()
     139                        # Object instance wasn't passed in -- must be an ID.
     140                        val = kwargs.pop(field.attname, field.get_default())
    144141                    else:
    145142                        # Object instance was passed in. Special case: You can
    146143                        # pass in "None" for related objects if it's allowed.
Back to Top