Fix middleware.py so PRIVATEBETA_REDIRECT_URL works and redirects to 'invites' rather than 'invite'.