From 696351e9b46d7964d28d8a1affd3aab143bc8347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 27 Jul 2016 12:51:17 +0200 Subject: [PATCH] Added some extra logging to find the source of a bug. In some cases we db_user['groups'] = [u'subscriber'], which is invalid (it should be a list of ObjectIDs), but I have no idea how it gets there. --- pillar/application/modules/blender_id.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pillar/application/modules/blender_id.py b/pillar/application/modules/blender_id.py index 5f9f78f7..f1938288 100644 --- a/pillar/application/modules/blender_id.py +++ b/pillar/application/modules/blender_id.py @@ -89,6 +89,10 @@ def upsert_user(db_user, blender_id_user_id): :type: (ObjectId, int) """ + if u'subscriber' in db_user.get('groups', []): + log.error('Non-ObjectID string found in user.groups: %s', db_user) + raise wz_exceptions.InternalServerError('Non-ObjectID string found in user.groups: %s' % db_user) + r = {} for retry in range(5): if '_id' in db_user: