Fix wrong Django query pattern