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.
This commit is contained in:
Sybren A. Stüvel 2016-07-27 12:51:17 +02:00
parent 1312ededfb
commit 696351e9b4

View File

@ -89,6 +89,10 @@ def upsert_user(db_user, blender_id_user_id):
:type: (ObjectId, int) :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 = {} r = {}
for retry in range(5): for retry in range(5):
if '_id' in db_user: if '_id' in db_user: