Skip to content

Commit 14cac0b

Browse files
committed
public shaming grace period
1 parent a89ca96 commit 14cac0b

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

‎constitutional.go‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func EvaluatePolls() {
116116
quorum := CalculateQuorum(*poll)
117117

118118
notVoted := make([]*OIDCUser, 0)
119-
notVotedString := make([]string, 0, len(notVoted))
119+
notVotedString := make([]string, 0)
120120
votedCount := 0
121121
// check all voters to see if they have voted
122122
if poll.AllowedUsers == nil {
@@ -154,14 +154,16 @@ func EvaluatePolls() {
154154
}
155155
notVotedString = append(notVotedString, "<@"+user.SlackUID+">")
156156
}
157-
// print non-voters to #announcements
158-
_, _, err = slackData.Client.PostMessage(slackData.AnnouncementsChannel,
159-
slack.MsgOptionText("It has been past the default time required to vote on \""+poll.Title+
160-
"\" These people have not completed their responsibility as a Voting Member of House. \n"+
161-
strings.Join(notVotedString, ","), false))
162-
if err != nil {
163-
logging.Logger.WithFields(logrus.Fields{"method": "EvaluatePolls notVoted announce"}).Error(err)
164-
continue
157+
// print non-voters to #announcements if we can't close the vote
158+
if !poll.OpenedTime.AddDate(0, 0, 2).After(now) {
159+
_, _, err = slackData.Client.PostMessage(slackData.AnnouncementsChannel,
160+
slack.MsgOptionText("It has been past the default time required to vote on \""+poll.Title+
161+
"\" These people have not completed their responsibility as a Voting Member of House. \n"+
162+
strings.Join(notVotedString, ","), false))
163+
if err != nil {
164+
logging.Logger.WithFields(logrus.Fields{"method": "EvaluatePolls notVoted announce"}).Error(err)
165+
continue
166+
}
165167
}
166168
continue
167169
}

0 commit comments

Comments
 (0)