4teamwork/ftw.mail — pull request #18 by lukasgraf (2014-05-02 09:21:53+00:00)
Title: Fix Upgrade-Step 2000: Only set a default for mail_domain, don't override existing values

In upgrade step `2000`'s [`registry.xml`](https://github.com/4teamwork/ftw.mail/blob/master/ftw/mail/upgrades/profiles/2000/registry.xml#L3) a value is being set for `IMailSettings.mail_domain`:

```

example.org

```
This is an actual value, not a default value. Because the registry setting `ftw.mail.interfaces.IMailSettings` was introduced in `2000`, it will act as a default value most of the time, but it has a nasty side effect: If you for example migrate a mail_domain setting to the new `IMailSettings.mail_domain` of ftw.mail, and run the `ftw.mail` upgrade step twice, it will override any existing value with `example.org`.

The actual default is already defined on the [interface](https://github.com/4teamwork/ftw.mail/blob/master/ftw/mail/interfaces.py#L51):

```
mail_domain = schema.TextLine(
# ...
default=u'example.org')
```