From 40c834020a92cf009e72e88bb1068e852a2e5ce5 Mon Sep 17 00:00:00 2001
From: b3yond <b3yond@riseup.net>
Date: Sun, 9 Sep 2018 14:57:40 +0200
Subject: [PATCH] logging confirmation links for debug purposes

---
 active_bots/telegrambot.py | 6 +++---
 frontend.py                | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/active_bots/telegrambot.py b/active_bots/telegrambot.py
index a52f197..bd833f0 100644
--- a/active_bots/telegrambot.py
+++ b/active_bots/telegrambot.py
@@ -16,17 +16,17 @@ class TelegramBot(Bot):
             if update.message.text.lower() == "/start":
                 user.add_telegram_subscribers(update.message.sender.id)
                 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
             elif update.message.text.lower() == "/stop":
                 user.remove_telegram_subscribers(update.message.sender.id)
                 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
             elif update.message.text.lower() == "/help":
                 tb.send_message(update.message.sender.id, "Send reports here 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
             else:
                 reports.append(Report(update.message.sender.username, self,
diff --git a/frontend.py b/frontend.py
index 82eebf8..cb948ce 100755
--- a/frontend.py
+++ b/frontend.py
@@ -39,13 +39,13 @@ def register_post():
         return dict(error='Email address already in use.')
     # send confirmation mail
     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(
                 email,
                 "Confirm your account",
-                "Complete your registration here: %s" % (
-                        url('confirm/' + city + '/%s' % db.user_token(email, password))
-                    )
+                "Complete your registration here: %s" % (link)
             )
         return dict(info='Confirmation mail sent.')
     except Exception: