Fix the Context.by_user query by joining with the right tables