>         if not cleaned.has_key("string2") and
> cleaned.has_key("string1"):
>             cleaned["string2"] = string1
>
>         return cleaned
>
I think the problem here is that if string2 is not required it will be
in the cleaned dictionary but an empty string. So instead you might
need:

if not cleaned.get('string2', ''):
    cleaned['string2'] = string1

I'd still suggest doing it like this though, not in the POST, as you
would need to do that in every view where you use the form.

Peter

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.


Reply via email to