summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorEvgeny Sorokin <me@ch1p.io>2024-07-15 20:26:12 +0300
committerEvgeny Sorokin <me@ch1p.io>2024-07-15 20:26:12 +0300
commit6fc1a8c95a1bfda62fe43da71e7ffadc40622cc6 (patch)
treeb2cee84b44b0719a99bfb97560ab2e91a1429f32 /bin
parent275d1384365b78101eeb464be108610d395fc987 (diff)
sms: hide pronetHEADmaster
Diffstat (limited to 'bin')
-rwxr-xr-xbin/web_kbn.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/web_kbn.py b/bin/web_kbn.py
index 9e7b22a..e52ee50 100755
--- a/bin/web_kbn.py
+++ b/bin/web_kbn.py
@@ -341,7 +341,11 @@ async def sms(req: web.Request):
error = req.query.get('error', None)
sent = int(req.query.get('sent', 0)) == 1
- cl = get_modem_client(ModemsConfig()[modem])
+ input_modem = ModemsConfig()[modem]
+ if input_modem['type'] != 'e3372':
+ raise ValueError('invalid modem')
+
+ cl = get_modem_client(input_modem)
messages = cl.sms_list(1, 20, is_outbox)
return await render(req, 'sms',
title=lang('sms_page_title') % (lang('sms_outbox') if is_outbox else lang('sms_inbox'), modem),
@@ -365,7 +369,7 @@ async def sms_post(req: web.Request):
text = fd.get('text', None)
return_url = f'sms.cgi?id={modem}&outbox={int(is_outbox)}'
- phone = re.sub('\s+', '', phone)
+ phone = re.sub(r'\s+', '', phone)
if len(phone) > 4:
country = None