Support for displaying votes, and entering votes through the website
Updated 2 years, 8 months ago
| Oliver Charles | Reviewers | ||
| Default | |||
| None | MusicBrainz git-svn mirror | ||
Adds a new data object - Data::Vote - to fetch votes for edits, and also to enter votes. Adds a new controller action - /edit/enter_votes - to enter votes for an edit, or a set of edits Updated the edit/index.tt to show votes and allow entering votes. edit/list.tt does not yet have support for entering votes
Unit tests on Data::Vote
Posted 2 years, 9 months ago (August 15th, 2009, 5 p.m.)
-
lib/MusicBrainz/Server/Controller/Edit.pm (Diff revision 2) -
Whoops, I need to remove this :D
Posted 2 years, 9 months ago (August 16th, 2009, 11:02 a.m.)
-
lib/MusicBrainz/Server/Data/Vote.pm (Diff revision 2) -
There is a race condition in this function. Some editor might vote on the same edits almost at the same time, then multiple votes could end up marked as not superseded and vote counts in the edit table would be wrong, too. You should lock the vote table in SHARE ROW EXCLUSIVE mode, so that no other transaction can modify it.
-
lib/MusicBrainz/Server/Entity/Vote.pm (Diff revision 2) -
I think this is a little confusing. We have been using type names Xxx for classes like MB::S::Entity::Xxx. The first reaction when I read this was, why does the vote link to itself? Perhaps the type should be renamed?
Review request changed
Updated 2 years, 9 months ago (August 19th, 2009, 4:22 p.m.)
-
- added Diff r3
Updated to allow voting on batches of edits from the edit listing pages, and also to avoid that race condition.
Posted 2 years, 8 months ago (August 21st, 2009, 6:10 p.m.)
-
lib/MusicBrainz/Server/Data/Vote.pm (Diff revision 3) -
Probably not mediums :)
-
lib/MusicBrainz/Server/Edit.pm (Diff revision 3) -
Can you please add here a check for email_confirmation_date and accepted_edit?
-
lib/MusicBrainz/Server/Entity/Vote.pm (Diff revision 3) -
I still think this should be renamed. "VoteOption" or something like that.
-
lib/MusicBrainz/Server/Entity/Vote.pm (Diff revision 3) -
Please add the GPL license footer here and to other new files.
-
root/edit/index.tt (Diff revision 3) -
"Enter vote", you have only a single vote here. Or maybe just "Vote".
-
root/edit/list.tt (Diff revision 3) -
I'd either move the user_exists check to edit/vote.tt or the editor_may_vote check here.
-
root/edit/list.tt (Diff revision 3) -
Either "Enter votes" or "Vote".
Review request changed
Updated 2 years, 8 months ago (August 23rd, 2009, 7:43 p.m.)
-
- added Diff r4
Changes from review
