Skip to content
This repository has been archived by the owner on Jan 8, 2021. It is now read-only.

Errors are occasionally thrown when connections contain None value #325

Open
mitar opened this issue Oct 2, 2012 · 0 comments
Open

Errors are occasionally thrown when connections contain None value #325

mitar opened this issue Oct 2, 2012 · 0 comments
Milestone

Comments

@mitar
Copy link
Member

mitar commented Oct 2, 2012

In our code for checking online users, we remove values from connections in two steps: first we set all stale data to None and then we remove all None values. It seems this has a problem that if user object is accessed just in between this two steps, MongoEngine throws an error: connections - 'NoneType' object has no attribute 'get. Connections object is something like this:

 u'connections': [None,
                  {u'channel_id': u'user/8624cec1-8010-4cfc-9b42-c3a297f5bfed',
                   u'http_if_modified_since': u'Thu, 1 Jan 1970 00:00:00 GMT',
                   u'http_if_none_match': u'0'},
                  {u'channel_id': u'home',
                   u'http_if_modified_since': u'Thu, 1 Jan 1970 00:00:00 GMT',
                   u'http_if_none_match': u'0'}],

It fails at line 979, mongoengine/mongoengine/base.py in _from_son.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant