|
|
|
@ -19,7 +19,8 @@ def alternative_create(domain_name):
|
|
|
|
|
if form.validate_on_submit():
|
|
|
|
|
conflicting_domain = models.Domain.query.get(form.name.data)
|
|
|
|
|
conflicting_alternative = models.Alternative.query.get(form.name.data)
|
|
|
|
|
if conflicting_domain or conflicting_alternative:
|
|
|
|
|
conflicting_relay = models.Relay.query.get(form.name.data)
|
|
|
|
|
if conflicting_domain or conflicting_alternative or conflicting_relay:
|
|
|
|
|
flask.flash('Domain %s is already used' % form.name.data, 'error')
|
|
|
|
|
else:
|
|
|
|
|
alternative = models.Alternative(domain=domain)
|
|
|
|
|