Creating domains with duplicate mail hosts doesn't result in a "nice" error
When creating a new domain with a duplicate mail host, the request is correctly denied.
The error shown is: HTTP Error 400: Duplicate email host: example.com
The error is shown on the domain index page, which is not really nice.
Ideally the error would be shown in the domain creation form under the mail host field, saying that the host is already associated with a domain.
This could be done in two ways:
- Check for valid entries in the clean method of the form. This would result in an extra rest call
- Check the errors during domain creation in the view and populate the form with the specific cause.
1 is easier to implement but comes with overhead. 2 would require us to check the possible http error codes returned and see if we can separate this one out.