4teamwork/ftw.mail — pull request #21 by lukasgraf (2014-07-11 15:13:58+00:00)
Title: Inbound: Remove acquisition wrapper when setting defaults

The check in [`ftw.mail.inbound.set_defaults()`](https://github.com/4teamwork/ftw.mail/blob/e58b53a78b4388a80d2827e0b727a0caeb98ab34/ftw/mail/inbound.py#L183) that's supposed to determine if a field is already present on the object currently doesn't work in all cases: If
- a schema's fields are stored using AttributeStorage
- the field is **not present** on the object itself
- but a field with the **same name** is present on a parent in the aq chain,

the field's value will be acquired from that parent, wrongly indicating that the field is present on the object.

I therefore changed that check to use an object that isn't acquisition wrapped.

I also changed the lookup of the default value adapter to adapt the **container** as the context, instead of the content object itself. This is what the regular add form does.