Closed btbonval closed 9 years ago
Looks like the proper solution to remove the above error is to check for not just if user
but also and type(user) is not AnonymousUser
:
https://github.com/FinalsClub/karmaworld/blob/master/karmaworld/apps/notes/gdrive.py#L243
note.text
is set, but crashes prior to the save.
https://github.com/FinalsClub/karmaworld/blob/master/karmaworld/apps/notes/gdrive.py#L229
https://github.com/FinalsClub/karmaworld/blob/master/karmaworld/apps/notes/gdrive.py#L256
Oh sweet, User
and AnonymousUser
both support is_anonymous()
method. Just checked in console and it appears to work as expected. if user and not user.is_anonymous()
seems like the right solution.
Yup, that fixed the preview. Strange that there is still a mention of no text found for IndexDen, followed by a mention that the file will be indexed.
[2015-01-27 14:16:09,636: WARNING/PoolWorker-4] html -- https://docs.google.com/feeds/download/documents/export/Export?id=1xNCJu4mADm1OAYPd147xCdmF9UFTMIXBwXzZKi3WGOA&exportFormat=html
[2015-01-27 14:16:09,859: WARNING/PoolWorker-4] downloaded!
[2015-01-27 14:16:12,497: INFO/MainProcess] Note Note at https://www.filepicker.io/api/file/plgR1vAR4qa6gF4HIfLU (from None) (1128) has no text, will not add to IndexDen
[2015-01-27 14:16:13,714: INFO/MainProcess] Indexing Note at https://www.filepicker.io/api/file/plgR1vAR4qa6gF4HIfLU (from None) (1128)
The no text notice appears twice in the code:
The indexing notice appears twice in the code:
The first two instances of each notice appear in add_note
while the second two instances of each case appear in update_note
. It looks like no text is found for add_note
but is found for update_note
.
That's annoying, but not worth spending time to fix. It looks like the preview text is generated and indexed. Pushing fix to master and closing ticket.
Uploaded a note. It worked and generated the correct preview. However, celery threw an error in the process.
Here's what Celery says: