Pretty sure this code runs during an HTTP request and not celery/cron/etc. Further, this gets sent when someone has forgotten their username, so they're not logged in.