Elections Plugin

(Lee Strickland) #61

The main reason is to allow consent for the unopposed nominee and keep everything centralized to the election topic without having to go elsewhere.

Almost all of the elections involve self-nomination and if oneself nominated person runs unopposed and no one votes for them they still shouldn’t get the position.


(Angus McLeod) #62

I see.

What I could add is a feature that allows a mod or admin to identify a ‘winner’ of the election at any stage of the election, i.e. nomination, poll, closed poll. That would also be useful to clarify the outcome of standard (contested) elections.

Would that fit your use case?


(Lee Strickland) #63

Yeah I think that works great.
We can always run a consent poll to confirm it as well

1 Like

(Angus McLeod) #64

Ok. I was actually thinking I should add that anyway. I’ll work on it a bit later in the week.

1 Like

(Lee Strickland) #65

Take your time. Your work is awesome and super appreciated!

1 Like

(Ferry) #66

Hey dude!

I am not sure if you’ve heard about this before, but here comes my story, haha. Today I installed your plugin and I experiemented with it. I deleted a thread with an election in it as I was testing the plugin itself, worked well. After I have deleted that thread I ran into a major issue for my website.

As soon as someone replied to a thread, or created a new thread, they would receive an error and the thread would just return a 404 error everytime you tried to access it.


I am not sure how this could’ve happened, but I really appreciate it if you would be able to help me out to fix this issue!


1 Like

(Angus McLeod) #67

Thanks for the report @JustFerry. There was an indeed an issue that arose if you deleted an election topic. It’s now fixed.

Updated code is live on my sandbox:

Current task list for this plugin:

  • Feature that allows a mod or admin to identify a ‘winner’ of the election at any stage of the election, i.e. nomination, poll, closed poll.

(Lee Strickland) #68

@angus If a user was nominated, then later is anonymized, their name in the election post will remain. Not functional problem but I would expect it to be scrubbed when anonymized.


(Angus McLeod) #69

Now when a user is anonymised, if they have any election nominations those nominations will also be anonymised.


I opted to anonymise the nomination rather than remove it, as removing it would change the nominee count and have other knock-on effects. Retaining an anonymised nomination is consistent with other anonymization behaviour (i.e. anonymised posts are retained).



(Angus McLeod) #70

You can now identify a “Winner” of the election at any stage of the election process in the “Manage Election” modal.

  • You can only identify one winner.

  • I allowed identification of a winner in the Nomination and Poll stages, as there may be cases (see above) in which you want to identify a winner without a poll or while polling is going on.

  • Selecting a winner does not effect the election state, i.e. if you select a winner when the poll is open it will not automatically close the poll.

  • The Winner is identified under the heading “Winner” at the top of the election post (i.e. the first post). Examples:


@usulrasolas This should handle your case.


(Speck Of The Cosmos) #71

Hi! Thanks for this plugin, we’re trying it out for a pseudo election in our organization (board is appointing but asking for input). I had an issue where I used the election interface to start the poll but when people tried to vote it would say “Poll must be open in order to vote.”

I finally figured out that if I put the election back to nominations and then pressed the start poll button, that the election would be truly open. Unfortunately I also sent “this poll is open” system messages 5 times trying to figure it out.

This is fine, it was an experiment and I got it working.

Then, 6 hours later, the poll started the error message again and I had to convert it back to nomination and start the poll again. We have the poll set to be open for the next 10 days. I’m hoping this doesn’t happen again in that process.

Is the need to press the start poll button an expected behavior of the plugin?

1 Like

(Angus McLeod) #72

Thanks for trying it out, and I’m sorry you’ve had issues with it. I’ll take a look at them closely tomorrow.

Just to be clear, the issues are:

  1. Changing the election status via the election admin modal started the poll, but users were unable to vote.

  2. Using ‘Start Poll’ to change the election status started the poll and users were able to vote.

  3. The ‘poll is open’ message was sent to the nominees in the election each time you changed the status via the election admin modal.

1 Like

(Speck Of The Cosmos) #73

Yes! That’s a good summary.


(Angus McLeod) #74

Ok, I’ve addressed the issues you raised:

  1. Changing the poll status via the election admin modal will now result in a poll that works:

    Fix status in poll markup builder · angusmcleod/discourse-elections@57952d2 · GitHub

  2. Status change messages will now go out to nominees 1 hour after the last status change:

    Delay nominee notifications by 1 hour and remove existing notifications · angusmcleod/discourse-elections@1f50763 · GitHub

Let me know how that goes


(Speck Of The Cosmos) #75

Ah I misread one part of your analysis. There’s a user_private_message status message that goes out to everyone on the discourse (who can see the poll) that says the poll is open as well. You might want to reproduce the hour delay for the last status change as well for them.

Thanks so much!

1 Like

(Angus McLeod) #76

There’s also a message that goes out to moderators. I’ve also delayed that by 1 hour.


But there shouldn’t be a message to goes out to every user. Can you double check it went to every user and not just the moderators and nominees?


(Speck Of The Cosmos) #77

You’re correct, it was just the moderators. I was wondering why it seemed so random who got the message lol.

1 Like

(Geoff Bowers) #78

Not sure if I’m an isolated case, but I’ve been experiencing errors on post updates with the latest Discourse upgrade. I fixed the issue by removing the Elections plugin. Just posting here in case its a more wide spread issue that needs a plugin update.


(Danny Goodall) #79

It LOOKS like you’ve recently updated to a version greater than 2.2.0 beta 3.

The entire structure of where polls are stored was changed in beta 4 (I think).
Instead of being JSON in custom fields, polls now have their own tables.

I’ve written an internal plugin that uses polls heavily and have recently had to refactor my code to achieve the same.

If I’m right then the elections plugin will need refactoring too.



Yeah I just updated today now I cant edit anything on the site. Gotta remove the plugin unfortunately and we have active polls open.