Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

require a minimum user karma to upvote and downvote #558

Merged
merged 3 commits into from
Feb 18, 2016

Conversation

xrpd
Copy link
Contributor

@xrpd xrpd commented Feb 16, 2016

This is intended to resolve issue #550.

A new global 'no_voting_threshold' is added. A user's karma must be greater than this value before the upvote and downvote icons will appear (i.e., before thing.votable is set to true). The modification to link.py is made in the two places that also prevent an author from upvoting their own articles and comments.

I modified example.ini, test.ini and provisioning/cookbooks/lesswrong/templates/default/development.ini.erb to include a 'no_voting_threshold' example. It will have to be added to a production .ini file to successfully implement this patch.

Tested with no_voting_threshold at various values. The voting icons appear and disappear depending on user karma as expected.

# If user's karma is less than threshold, thing.votable = False
# meaning that the voting icons won't appear on posts and comments
# "karma_to_vote" is only used for voting in polls.
no_voting_threshold = 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this setting should be renamed to remove the negative no and be clearer about what the value is. The best way to do this may be to rename karma_to_vote to karma_to_vote_on_polls and make this setting karma_to_vote.

@xrpd
Copy link
Contributor Author

xrpd commented Feb 18, 2016

Agreed, and will do. I was just wary of renaming existing configuration options without encouragement.

@xrpd
Copy link
Contributor Author

xrpd commented Feb 18, 2016

@wezm global configuration parameters renamed per your suggestion.

@wezm
Copy link
Contributor

wezm commented Feb 18, 2016

Looks good. @cdaloisio note that ini file changes will be needed before this can be deployed.

@cdaloisio
Copy link
Contributor

Great 👍 Production config values are now as follows:

karma_to_vote = 10
karma_to_vote_on_polls = 0

cdaloisio added a commit that referenced this pull request Feb 18, 2016
require a minimum user karma to upvote and downvote
@cdaloisio cdaloisio merged commit b470c5f into bellroy:master Feb 18, 2016
@cdaloisio
Copy link
Contributor

Closes #550

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants