From 9f97cb2769c1598a082f641aa3aa72b104485eac Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 13 Aug 2016 23:38:43 +0200 Subject: [PATCH] fix SameIpError in host add form processing, fixes #267 --- nsupdate/main/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nsupdate/main/views.py b/nsupdate/main/views.py index c40297e..5454bab 100644 --- a/nsupdate/main/views.py +++ b/nsupdate/main/views.py @@ -236,6 +236,8 @@ class AddHostView(CreateView): except Domain.DoesNotExist: # should not happen: POST data had invalid (base)domain 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: success, level, msg = False, messages.ERROR, 'Communication to name server failed [%s]' % str(err) else: