From 6973128eaca9ad8e5d2191e18ba7c6dcfada497d 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 35ab445..3ba708b 100644 --- a/isso/ext/notifications.py +++ b/isso/ext/notifications.py @@ -72,7 +72,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')