logging confirmation links for debug purposes
This commit is contained in:
parent
185014a452
commit
40c834020a
|
@ -16,17 +16,17 @@ class TelegramBot(Bot):
|
||||||
if update.message.text.lower() == "/start":
|
if update.message.text.lower() == "/start":
|
||||||
user.add_telegram_subscribers(update.message.sender.id)
|
user.add_telegram_subscribers(update.message.sender.id)
|
||||||
tb.send_message(update.message.sender.id, "You are now \
|
tb.send_message(update.message.sender.id, "You are now \
|
||||||
subscribed to report notifications.")
|
subscribed to report notifications.")
|
||||||
#TODO: /start message should be set in frontend
|
#TODO: /start message should be set in frontend
|
||||||
elif update.message.text.lower() == "/stop":
|
elif update.message.text.lower() == "/stop":
|
||||||
user.remove_telegram_subscribers(update.message.sender.id)
|
user.remove_telegram_subscribers(update.message.sender.id)
|
||||||
tb.send_message(update.message.sender.id, "You are now \
|
tb.send_message(update.message.sender.id, "You are now \
|
||||||
unsubscribed from report notifications.")
|
unsubscribed from report notifications.")
|
||||||
#TODO: /stop message should be set in frontend
|
#TODO: /stop message should be set in frontend
|
||||||
elif update.message.text.lower() == "/help":
|
elif update.message.text.lower() == "/help":
|
||||||
tb.send_message(update.message.sender.id, "Send reports here to \
|
tb.send_message(update.message.sender.id, "Send reports here to \
|
||||||
share them with other users. Use /start and /stop to \
|
share them with other users. Use /start and /stop to \
|
||||||
be included/excluded.")
|
be included/excluded.")
|
||||||
#TODO: /help message should be set in frontend
|
#TODO: /help message should be set in frontend
|
||||||
else:
|
else:
|
||||||
reports.append(Report(update.message.sender.username, self,
|
reports.append(Report(update.message.sender.username, self,
|
||||||
|
|
|
@ -39,13 +39,13 @@ def register_post():
|
||||||
return dict(error='Email address already in use.')
|
return dict(error='Email address already in use.')
|
||||||
# send confirmation mail
|
# send confirmation mail
|
||||||
try:
|
try:
|
||||||
print(url('confirm/' + city + '/%s' % db.user_token(email, password))) # only for local testing
|
link = url('confirm/' + city + '/%s' % db.user_token(email, password))
|
||||||
|
print(link) # only for local testing
|
||||||
|
logger.info('confirmation link to ' + email + ": " + link)
|
||||||
sendmail(
|
sendmail(
|
||||||
email,
|
email,
|
||||||
"Confirm your account",
|
"Confirm your account",
|
||||||
"Complete your registration here: %s" % (
|
"Complete your registration here: %s" % (link)
|
||||||
url('confirm/' + city + '/%s' % db.user_token(email, password))
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
return dict(info='Confirmation mail sent.')
|
return dict(info='Confirmation mail sent.')
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
Loading…
Reference in a new issue