From 1a063ba66114b1f338f9624b2ab08332411af51b Mon Sep 17 00:00:00 2001 From: bashmak Date: Fri, 18 Aug 2017 17:26:05 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D1=83=20=D0=BD=D0=B0?= =?UTF-8?q?=20=D1=81=D0=BB=D1=83=D1=87=D0=B0=D0=B9=20=D0=B5=D1=81=D0=BB?= =?UTF-8?q?=D0=B8=20=D0=BD=D0=B5=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=D0=B0?= =?UTF-8?q?=D1=91=D0=BC=20=D0=B2=20=D0=BF=D0=B8=D0=BD=D0=B3=20ip=20=D0=B0?= =?UTF-8?q?=D0=B4=D1=80=D0=B5=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- abonapp/locale/ru/LC_MESSAGES/django.po | 3 +++ abonapp/views.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/abonapp/locale/ru/LC_MESSAGES/django.po b/abonapp/locale/ru/LC_MESSAGES/django.po index 63f19d5..7e81d54 100644 --- a/abonapp/locale/ru/LC_MESSAGES/django.po +++ b/abonapp/locale/ru/LC_MESSAGES/django.po @@ -948,3 +948,6 @@ msgstr "Привязать услуги к этой группе" msgid "User that is no staff can not buy admin services" msgstr "Пользователь, который не является персоналом не может покупать услуги для внутренних нужд" + +msgid "Ip not passed" +msgstr "Ip адрес не передан" diff --git a/abonapp/views.py b/abonapp/views.py index a08d9ea..b47f23d 100644 --- a/abonapp/views.py +++ b/abonapp/views.py @@ -738,6 +738,8 @@ def abon_ping(request): status = False text = ' %s' % _('no ping') try: + if ip is None: + raise mydefs.LogicError(_('Ip not passed')) tm = Transmitter() ping_result = tm.ping(ip) if ping_result is None: @@ -756,7 +758,7 @@ def abon_ping(request): text = ' %s' % _('ping ok') + ' ' + str(ping_result) status = True - except NasFailedResult as e: + except (NasFailedResult, mydefs.LogicError) as e: messages.error(request, e) except NasNetworkError as e: messages.warning(request, e)