Ticket #3727: newforms_save_instance.diff

File newforms_save_instance.diff, 642 bytes (added by Matias Hermanrud Fjeld <mhf@…>, 18 years ago)

diff against r4741

  • django/newforms/models.py

     
    3636        raise ValueError("The %s could not be changed because the data didn't validate." % opts.object_name)
    3737    clean_data = form.clean_data
    3838    for f in opts.fields:
    39         if not f.editable or isinstance(f, models.AutoField):
     39        if not f.editable or isinstance(f, models.AutoField) \
     40           or f.name not in clean_data:
    4041            continue
    4142        setattr(instance, f.name, clean_data[f.name])
    4243    if commit:
Back to Top