Moved LogEntry query into try/except block.
Merge pull request #3079 from addgene/mw/login-fix

Toolbar middleware can raise an IndexError when logging in