Merge pull request #271 from ThomasWaldmann/fix-hostadd-sameip-crash

fix SameIpError in host add form processing, fixes #267
This commit is contained in:
TW 2016-08-13 23:56:25 +02:00 committed by GitHub
commit 9d30ca1014

View File

@ -236,6 +236,8 @@ class AddHostView(CreateView):
except Domain.DoesNotExist: except Domain.DoesNotExist:
# should not happen: POST data had invalid (base)domain # should not happen: POST data had invalid (base)domain
success, level, msg = False, messages.ERROR, 'Base domain does not exist.' success, level, msg = False, messages.ERROR, 'Base domain does not exist.'
except dnstools.SameIpError:
success, level, msg = False, messages.ERROR, 'Host already exists in DNS.'
except socket.error as err: except socket.error as err:
success, level, msg = False, messages.ERROR, 'Communication to name server failed [%s]' % str(err) success, level, msg = False, messages.ERROR, 'Communication to name server failed [%s]' % str(err)
else: else: