Ensure that unnecessary tg messages will not crash anything useful
This commit is contained in:
+10
-6
@@ -50,12 +50,16 @@ def ohlhafv_submit(request, *args, **kwargs):
|
||||
)
|
||||
send_email(email, subject, message)
|
||||
|
||||
tg_message = render_to_string(
|
||||
'ohlhafv:tgmsg.tpl', {
|
||||
'challenge': challenge,
|
||||
'url': url})
|
||||
bot = TelegramBot()
|
||||
bot.broadcast(tg_message)
|
||||
try:
|
||||
tg_message = render_to_string(
|
||||
'ohlhafv:tgmsg.tpl', {
|
||||
'challenge': challenge,
|
||||
'url': url})
|
||||
bot = TelegramBot()
|
||||
bot.broadcast(tg_message)
|
||||
except: # tg spam is not critical. Ignore on failure
|
||||
pass
|
||||
|
||||
logging.debug(
|
||||
'Sent ohlhafv email to recipient <{}>'.format(email))
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user