summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--service/pixelated/config/services.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/service/pixelated/config/services.py b/service/pixelated/config/services.py
index 494be703..f060c27c 100644
--- a/service/pixelated/config/services.py
+++ b/service/pixelated/config/services.py
@@ -98,9 +98,10 @@ class ServicesFactory(object):
def destroy_session(self, user_id, using_email=False):
if using_email:
- user_id = self._map_email[user_id.split('@')[0]]
+ username = user_id.split('@')[0]
+ user_id = self._map_email.get(username, None)
- if self.has_session(user_id):
+ if user_id is not None and self.has_session(user_id):
_services = self._services_by_user[user_id]
_services.close()
del self._services_by_user[user_id]