From 7e58f6b97c897a5f5136327b23f3a2140e1f1d92 Mon Sep 17 00:00:00 2001 From: Julien Enselme Date: Sat, 7 Mar 2015 16:00:24 +0100 Subject: [PATCH] Correct auth without password or username. If no username is set, returns an empty string. So the test `username is not None` is always True. Idem for password. This can lead to authentication problems. This commit fixes the test to `if username and password` as it was in the previous version. --- isso/ext/notifications.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isso/ext/notifications.py b/isso/ext/notifications.py index f027c20..fbc5f00 100644 --- a/isso/ext/notifications.py +++ b/isso/ext/notifications.py @@ -67,7 +67,7 @@ class SMTP(object): username = self.conf.get('username') password = self.conf.get('password') - if username is not None and password is not None: + if username and password: if PY2K: username = username.encode('ascii') password = password.encode('ascii')