From 44ebdcaa08bc9a2d6ceff03ff93bd8248b2ffad3 Mon Sep 17 00:00:00 2001 From: Davide Alberani Date: Mon, 20 Feb 2017 21:30:41 +0100 Subject: [PATCH] introduce the isRegistered key for registered users --- ibt2.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ibt2.py b/ibt2.py index aea533f..792844e 100755 --- a/ibt2.py +++ b/ibt2.py @@ -87,9 +87,8 @@ class BaseHandler(tornado.web.RequestHandler): :type data: dict""" if isinstance(data, dict): for key in list(data.keys()): - if (isinstance(key, str) and key.startswith('$')) or key in ('_id', 'created_by', - 'created_at', 'updated_by', - 'updated_at'): + if (isinstance(key, str) and key.startswith('$')) or key in ('_id', 'created_by', 'created_at', + 'updated_by', 'updated_at', 'isRegistered'): del data[key] return data @@ -135,6 +134,7 @@ class BaseHandler(tornado.web.RequestHandler): user = self.db.getOne('users', {'_id': user_info['_id']}) if user: user_info = user + user_info['isRegistered'] = True self._users_cache[current_user] = user_info return user_info