Ticket #10643: formtools_utils.diff

File formtools_utils.diff, 676 bytes (added by Nils Fredrik Gjerull, 16 years ago)
  • django/contrib/formtools/utils.py

     
    1515    order, pickles the result with the SECRET_KEY setting, then takes an md5
    1616    hash of that.
    1717    """
    18 
    19     data = [(bf.name, bf.field.clean(bf.data) or '') for bf in form]
     18    if form.empty_permitted and not form.has_changed():
     19        data = [(bf.name, bf.data or '') for bf in form]
     20    else:
     21        data = [(bf.name, bf.field.clean(bf.data) or '') for bf in form]
    2022    data.extend(args)
    2123    data.append(settings.SECRET_KEY)
    2224
Back to Top