Verified Commit 9204b761 authored by Kevin Morris's avatar Kevin Morris
Browse files

fix: ...do not add to ActiveTUs when voting on a proposal

Straight up bug.

Closes #324

Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
parent b63ac7ce
...@@ -220,7 +220,6 @@ async def trusted_user_proposal_post(request: Request, proposal: int, ...@@ -220,7 +220,6 @@ async def trusted_user_proposal_post(request: Request, proposal: int,
with db.begin(): with db.begin():
vote = db.create(models.TUVote, User=request.user, VoteInfo=voteinfo) vote = db.create(models.TUVote, User=request.user, VoteInfo=voteinfo)
voteinfo.ActiveTUs += 1
context["error"] = "You've already voted for this proposal." context["error"] = "You've already voted for this proposal."
return render_proposal(request, context, proposal, voteinfo, voters, vote) return render_proposal(request, context, proposal, voteinfo, voters, vote)
......
...@@ -650,7 +650,6 @@ def test_tu_proposal_vote(client, proposal): ...@@ -650,7 +650,6 @@ def test_tu_proposal_vote(client, proposal):
# Store the current related values. # Store the current related values.
yes = voteinfo.Yes yes = voteinfo.Yes
active_tus = voteinfo.ActiveTUs
cookies = {"AURSID": tu_user.login(Request(), "testPassword")} cookies = {"AURSID": tu_user.login(Request(), "testPassword")}
with client as request: with client as request:
...@@ -661,7 +660,6 @@ def test_tu_proposal_vote(client, proposal): ...@@ -661,7 +660,6 @@ def test_tu_proposal_vote(client, proposal):
# Check that the proposal record got updated. # Check that the proposal record got updated.
assert voteinfo.Yes == yes + 1 assert voteinfo.Yes == yes + 1
assert voteinfo.ActiveTUs == active_tus + 1
# Check that the new TUVote exists. # Check that the new TUVote exists.
vote = db.query(TUVote, TUVote.VoteInfo == voteinfo, vote = db.query(TUVote, TUVote.VoteInfo == voteinfo,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment