Can you add a docstring? It's not clear to me what this func is doing or why you need to query the VotesSummary table again, once for each party.