Commit 5253f9fa authored by Gualter's avatar Gualter

Increase review limit to 5 per event and peer/expert (#221)

parent e919f5f5
......@@ -102,11 +102,11 @@ class Ability
event.conference == @conference and # Is in the correct conference
not event.review_reservations.where(person: @user.person).any? and # Has not already been reserved by user
not event.event_ratings.where(person: @user.person).any? and # Has not already reviewed
(event.ratings_by_submitters + event.peer_review_reservations_count) < 2 and # has neither 2 reviews by peers, nor 2 reservations, nor 1 review 1 reservation
(event.ratings_by_submitters + event.peer_review_reservations_count) < 5 and # Has less than 5 reviews + reservations by peers
not event.people.where(id: @user.person.id).any? and # Submitter is not part of
event.current_state.in?([:submission_finished, :review]) and # submission has the correct state
@conference.ip_peer_review_deadline > DateTime.now and # Deadline did not end
(@user.person.review_reservations.peer_reservations.count + @user.person.event_ratings.peer_reviews.count) < 2 # does not have 2 reviews, 2 reservations or one review + 1 reservation
(@user.person.review_reservations.peer_reservations.count + @user.person.event_ratings.peer_reviews.count) < 5 # Has less than 5 reviews + reservations
end
# Can free an event from reservation if it was reserved as a peer by the user
......@@ -228,10 +228,10 @@ class Ability
not event.event_ratings.where(person: @user.person).any? and # Did not already review
if event.is_special_session?
not event.conference.ss_review_deadline.past? and # Special Session Review Deadline not over
(event.expert_review_reservations_count + event.ratings_by_reviewers) < 5 # Event does not have either 2 Reservations or 2 Reviews or 1 Reservation and 1 Review
(event.expert_review_reservations_count + event.ratings_by_reviewers) < 5 # Event does not have either 5 Reservations + Reviews
else
not event.conference.ip_expert_review_deadline.past? and # Individual Paper Review Deadline not over
(event.expert_review_reservations_count + event.ratings_by_reviewers) < 2 # Event is neither reserved nor reviewed by an expert
(event.expert_review_reservations_count + event.ratings_by_reviewers) < 5 # Event is neither reserved nor reviewed by an expert
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment