Ticket #3370: models.py.2.diff

File models.py.2.diff, 689 bytes (added by Esaj, 18 years ago)

Fix bug in previous patch...

  • django/newforms/models.py

     
    2929    opts = instance.__class__._meta
    3030    if form.errors:
    3131        raise ValueError("The %s could not be changed because the data didn't validate." % opts.object_name)
    32     clean_data = form.clean_data
     32    clean_data = dict([
     33        (k, (isinstance(v, unicode) and (lambda: v.encode(settings.DEFAULT_CHARSET)) or (lambda: v)())
     34        for k, v in form.clean_data.items()
     35    ])
    3336    for f in opts.fields:
    3437        if isinstance(f, models.AutoField):
    3538            continue
Back to Top