Elections Plugin

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.

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?

2 Likes

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

1 Like

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

1 Like

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

1 Like

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.

Example:

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!

Cheers.
Ferry

1 Like

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

https://github.com/angusmcleod/discourse-elections/commit/766076882352fd1bb019d9d6089e03a380d61a69

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.
4 Likes

@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.

2 Likes

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

https://github.com/angusmcleod/discourse-elections/commit/7bf1dfb468167125e85377e360ca5824b3f58a16

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).

Example:

9 Likes

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:

https://github.com/angusmcleod/discourse-elections/commit/b922c1aa0297746ea416225e8fc1e5545500924d

@usulrasolas This should handle your case.

4 Likes

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

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

Yes! That’s a good summary.

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:

    https://github.com/angusmcleod/discourse-elections/commit/57952d27c1a081601540686087c43bb126c67e21

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

    https://github.com/angusmcleod/discourse-elections/commit/1f50763e1cf5756bb63c1d1e74faaf5b7afd0db9

Let me know how that goes

4 Likes

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

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

https://github.com/angusmcleod/discourse-elections/commit/b839a2dbb8a8dea3f2a0f7b154d7f80e4b8531f2

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?

2 Likes

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

1 Like

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.

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.

3 Likes

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