Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

Commit 1ed6677

Browse files
committed
Fix index for first option
1 parent 942a711 commit 1ed6677

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pollbot/models/option.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ def __init__(self, poll, name):
5252
"""Create a new poll."""
5353
self.poll = poll
5454
self.name = name
55-
self.index = max(option.index for option in poll.options) + 1
55+
if len(option.index) == 0:
56+
option.index = 0
57+
else:
58+
self.index = max(option.index for option in poll.options) + 1
5659

5760
def __repr__(self):
5861
"""Print as string."""

0 commit comments

Comments
 (0)