SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit bdc9cc80 authored by George Katsikas's avatar George Katsikas :goat:
Browse files

fix calculation of voter senior colleges

parent 3c08b6fc
No related branches found
No related tags found
No related merge requests found
...@@ -277,9 +277,12 @@ class FellowshipNominationVotingRound(models.Model): ...@@ -277,9 +277,12 @@ class FellowshipNominationVotingRound(models.Model):
if is_edadmin(user): if is_edadmin(user):
return True return True
fellowships = user.contributor.fellowships.active().senior() user_senior_colleges = (
senior_in_college = self.nomination.college in fellowships.values("college") user.contributor.fellowships.active()
.senior()
.values_list("college__id", flat=True)
)
senior_in_college = self.nomination.college.id in user_senior_colleges
eligibility_per_fellowship = [ eligibility_per_fellowship = [
fellowship in self.eligible_to_vote.all() fellowship in self.eligible_to_vote.all()
for fellowship in user.contributor.fellowships.all() for fellowship in user.contributor.fellowships.all()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment