Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalised Review System, complete email functionality #5387

Merged
merged 8 commits into from
Aug 14, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minor fix
  • Loading branch information
nithusha21 committed Aug 12, 2018
commit 1d631eda38de705eddced56422d3b0d6de1350f8
32 changes: 16 additions & 16 deletions core/domain/suggestion_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,18 +236,22 @@ def accept_suggestion(suggestion, reviewer_id, commit_message, review_message):
suggestion.suggestion_id, reviewer_id,
feedback_models.STATUS_CHOICES_FIXED, None, review_message)

if feconf.SEND_SUGGESTION_REVIEW_RELATED_EMAILS:
scores = get_all_scores_of_user(suggestion.author_id)
if (
suggestion.score_category in scores and
scores[suggestion.score_category] >=
feconf.MINIMUM_SCORE_REQUIRED_TO_REVIEW):
if check_if_email_has_been_sent_to_user(
suggestion.author_id, suggestion.score_category):
email_manager.send_mail_to_onboard_new_reviewers(
suggestion.author_id, suggestion.score_category)
mark_email_has_been_sent_to_user(
suggestion.author_id, suggestion.score_category)
if feconf.ENABLE_RECORDING_OF_SCORES:
increment_score_for_user(
suggestion.author_id, suggestion.score_category,
suggestion_models.INCREMENT_SCORE_OF_AUTHOR_BY)
if feconf.SEND_SUGGESTION_REVIEW_RELATED_EMAILS:
scores = get_all_scores_of_user(suggestion.author_id)
if (
suggestion.score_category in scores and
scores[suggestion.score_category] >=
feconf.MINIMUM_SCORE_REQUIRED_TO_REVIEW):
if check_if_email_has_been_sent_to_user(
suggestion.author_id, suggestion.score_category):
email_manager.send_mail_to_onboard_new_reviewers(
suggestion.author_id, suggestion.score_category)
mark_email_has_been_sent_to_user(
suggestion.author_id, suggestion.score_category)


def reject_suggestion(suggestion, reviewer_id, review_message):
Expand All @@ -272,10 +276,6 @@ def reject_suggestion(suggestion, reviewer_id, review_message):
feedback_services.create_message(
suggestion.suggestion_id, reviewer_id,
feedback_models.STATUS_CHOICES_IGNORED, None, review_message)
if feconf.ENABLE_RECORDING_OF_SCORES:
increment_score_for_user(
suggestion.author_id, suggestion.score_category,
suggestion_models.INCREMENT_SCORE_OF_AUTHOR_BY)


def get_user_contribution_scoring_from_model(userContributionScoringModel):
Expand Down