Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix metadata formatting workarounds on the server
As described in e-mission/cordova-usercache#17, it looks like we never actually passed in a timezone from the client, which means that the code to check for timezone validity was never tested. And of course, that which is not tested is broken. Fix the check by adding appropriate imports and module names. With this change, we now store the incoming config ``` 2016-07-25 15:28:17,503:DEBUG:module_name = emission.net.usercache.formatters.ios.consent 2016-07-25 15:28:17,555:DEBUG:write_ts = 1469477974 2016-07-25 15:28:17,556:DEBUG:insert called 2016-07-25 15:28:17,556:DEBUG:entry was fine, no need to fix it 2016-07-25 15:28:17,557:DEBUG:Inserting entry AttrDict({u'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), u'_id': ObjectId('57969202115514afcd79338b'), u'data': AttrDict({u'category': u'emSensorDataCollectionProtocol', u'approval_date': u'2016-07-14', u'protocol_id': u'2014-04-6267'}), u'metadata': AttrDict({u'platform': u'ios', 'write_local_dt': LocalDate({'hour': 13, 'month': 7, 'second': 34, 'weekday': 0, 'year': 2016, 'timezone': u'America/Los_Angeles', 'day': 25, 'minute': 19}), u'read_ts': 0, u'key': u'config/consent', u'plugin': u'none', u'write_ts': 1469477974, u'type': u'rw-document', u'time_zone': u'America/Los_Angeles', 'write_fmt_time': '2016-07-25T13:19:34-07:00'})}) into timeseries ``` and return it as a document. ``` 2016-07-25 15:28:45,014:DEBUG:finished querying values for ['config/consent'] 2016-07-25 15:28:45,014:DEBUG:finished querying values for [] 2016-07-25 15:28:45,015:DEBUG:Found 2 user overrides for user 0763de67-f61e-3f5d-90e7-518e69793954 2016-07-25 15:28:45,015:DEBUG:last entry is Entry({u'user_id': UUID('0763de67-f61e-3f5d-90e7-518e69793954'), u'_id': ObjectId('57969202115514afcd79338b'), u'data': {u'category': u'emSensorDataCollectionProtocol', u'approval_date': u'2016-07-14', u'protocol_id': u'2014-04-6267'}, u'metadata': {u'write_fmt_time': u'2016-07-25T13:19:34-07:00', u'write_ts': 1469477974, u'plugin': u'none', u'time_zone': u'America/Los_Angeles', u'platform': u'ios', u'write_local_dt': {u'hour': 13, u'month': 7, u'second': 34, u'weekday': 0, u'year': 2016, u'timezone': u'America/Los_Angeles', u'day': 25, u'minute': 19}, u'key': u'config/consent', u'read_ts': 0, u'type': u'rw-document'}}) 2016-07-25 15:28:45,015:DEBUG:for 0763de67-f61e-3f5d-90e7-518e69793954, config is Consentconfig({u'category': u'emSensorDataCollectionProtocol', u'approval_date': u'2016-07-14', u'protocol_id': u'2014-04-6267'}) 2016-07-25 15:28:45,016:DEBUG:Result = {'updatedExisting': False, u'nModified': 0, u'ok': 1, u'upserted': ObjectId('5796929d115514afcd793398'), u'n': 1} after updating document config/consent ```
- Loading branch information