Skip to content

Commit d2d3f7d

Browse files
committed
Bugfix - don't remove votes for duplicate "nonvoter"
1 parent f0b4211 commit d2d3f7d

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

gitconsensus/repository.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -145,22 +145,23 @@ def __init__(self, repository, number):
145145

146146
if 'prevent_doubles' in self.repository.rules and self.repository.rules['prevent_doubles']:
147147
# make sure user hasn't voted twice
148-
if username in self.users:
149-
self.doubles.append(username)
150-
self.users.remove(username)
151-
if username in self.yes:
152-
self.yes.remove(username)
153-
if username in self.no:
154-
self.no.remove(username)
155-
if username in self.abstain:
156-
self.abstain.remove(username)
157-
if username in self.contributors_yes:
158-
self.contributors_yes.remove(username)
159-
if username in self.contributors_no:
160-
self.contributors_no.remove(username)
161-
if username in self.contributors_abstain:
162-
self.contributors_abstain.remove(username)
163-
continue
148+
if content == '+1' or content == '-1' or content == 'confused':
149+
if username in self.users:
150+
self.doubles.append(username)
151+
self.users.remove(username)
152+
if username in self.yes:
153+
self.yes.remove(username)
154+
if username in self.no:
155+
self.no.remove(username)
156+
if username in self.abstain:
157+
self.abstain.remove(username)
158+
if username in self.contributors_yes:
159+
self.contributors_yes.remove(username)
160+
if username in self.contributors_no:
161+
self.contributors_no.remove(username)
162+
if username in self.contributors_abstain:
163+
self.contributors_abstain.remove(username)
164+
continue
164165

165166
if content == '+1':
166167
self.users.append(user['login'])

0 commit comments

Comments
 (0)