This is a follow-up to #157, which redirected back after discarding instead of redirecting to the failed job page always, since you can discard a job from the scheduled jobs page as well. However, this doesn't work in the case of discarding a job from its individual page, because in that case we'd try to redirect to the job, and the job no longer exists, which results in a 404.
With this change, we just redirect to wherever the status of the discarded job is.
This is a follow-up to #157, which redirected back after discarding instead of redirecting to the failed job page always, since you can discard a job from the scheduled jobs page as well. However, this doesn't work in the case of discarding a job from its individual page, because in that case we'd try to redirect to the job, and the job no longer exists, which results in a 404.
With this change, we just redirect to wherever the status of the discarded job is.