diff options
author | Evgeny Sorokin <me@ch1p.io> | 2024-07-15 20:26:12 +0300 |
---|---|---|
committer | Evgeny Sorokin <me@ch1p.io> | 2024-07-15 20:26:12 +0300 |
commit | 6fc1a8c95a1bfda62fe43da71e7ffadc40622cc6 (patch) | |
tree | b2cee84b44b0719a99bfb97560ab2e91a1429f32 /bin | |
parent | 275d1384365b78101eeb464be108610d395fc987 (diff) |
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/web_kbn.py | 8 |
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 |