From a73aff927a581d1f1814c7b7df142316559ca39b Mon Sep 17 00:00:00 2001 From: pythagoraswitch Date: Fri, 3 Aug 2018 19:17:44 +0200 Subject: [PATCH] fixed the bug on login event check --- recommendation_engine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recommendation_engine.py b/recommendation_engine.py index 2f1beb9..cf8cbc0 100644 --- a/recommendation_engine.py +++ b/recommendation_engine.py @@ -86,7 +86,7 @@ class Engine: def get_videos(self, user): - if user.get('events', [])[0].get("event")=="login": + if user.get('events', [{}])[0].get("event")=="login": return self.get_recommendations(user) channels = {k: v.get('value', 0) for k, v in self.state['channels'].items()}