tomhaymore / prosperime

0 stars 0 forks source link

lilib.process_li_connections doesn't check if LI account is unlinked, bugs on comparing expires_on #3

Closed tomhaymore closed 11 years ago

tomhaymore commented 11 years ago

Traceback (most recent call last): 2013-06-25T22:00:31.456797+00:00 app[celeryd.1]: File "/app/.heroku/python/lib/python2.7/site-packages/celery/task/trace.py", line 224, in trace_task 2013-06-25T22:00:31.456797+00:00 app[celeryd.1]: R = retval = fun(_args, _kwargs) 2013-06-25T22:00:31.456797+00:00 app[celeryd.1]: File "/app/.heroku/python/lib/python2.7/site-packages/celery/task/trace.py", line 406, in protected_call 2013-06-25T22:00:31.456797+00:00 app[celeryd.1]: return self.run(_args, _kwargs) 2013-06-25T22:00:31.456797+00:00 app[celeryd.1]: File "/app/prosperime/accounts/tasks.py", line 35, in process_li_connections 2013-06-25T22:00:31.456797+00:00 app[celeryd.1]: li_cxn_parser.process_connections() 2013-06-25T22:00:31.456797+00:00 app[celeryd.1]: File "/app/prosperime/accounts/lilib.py", line 961, in process_connections 2013-06-25T22:00:31.456797+00:00 app[celeryd.1]: connections = self.get_connections() 2013-06-25T22:00:31.456988+00:00 app[celeryd.1]: File "/app/prosperime/accounts/lilib.py", line 928, in get_connections 2013-06-25T22:00:31.456988+00:00 app[celeryd.1]: content = self.fetch_data_oauth(self.acct.id,self.api_url) 2013-06-25T22:00:31.456988+00:00 app[celeryd.1]: File "/app/prosperime/accounts/lilib.py", line 255, in fetch_data_oauth 2013-06-25T22:00:31.456988+00:00 app[celeryd.1]: access_token = self.get_access_token(self.acct.id) 2013-06-25T22:00:31.456988+00:00 app[celeryd.1]: File "/app/prosperime/accounts/lilib.py", line 228, in get_access_token 2013-06-25T22:00:31.456988+00:00 app[celeryd.1]: if self.acct.expires_on <= datetime.now(): 2013-06-25T22:00:31.456988+00:00 app[celeryd.1]: TypeError: can't compare datetime.datetime to NoneType

tomhaymore commented 11 years ago

Added fix (returns an error) and test (accounts.test), passed test