diff --git a/docs/setup/administrators/configuration.md b/docs/setup/administrators/configuration.md index 0e13424a6c..bf9301b48d 100644 --- a/docs/setup/administrators/configuration.md +++ b/docs/setup/administrators/configuration.md @@ -160,6 +160,14 @@ Possible values are: fund, round, status, lead, reviewers, screening_statuses, c SUBMISSIONS_TABLE_EXCLUDED_FIELDS = env.list('SUBMISSIONS_TABLE_EXCLUDED_FIELDS', []) +### Default visibility for reviews. + +Possible values are: 'reviewers' or 'private'. +Private: Visible only to staff. +Reviewers: Visible to other reviewers and staff. + + REVIEW_VISIBILITY_DEFAULT = env.str('REVIEW_VISIBILITY_DEFAULT', 'private') + ### Should submission automatically transition after all reviewer roles are assigned. TRANSITION_AFTER_ASSIGNED = env.bool('TRANSITION_AFTER_ASSIGNED', False) diff --git a/hypha/apply/review/blocks.py b/hypha/apply/review/blocks.py index 988bdfc44b..2bc25ca696 100644 --- a/hypha/apply/review/blocks.py +++ b/hypha/apply/review/blocks.py @@ -1,6 +1,7 @@ import json from django import forms +from django.conf import settings from django.utils.safestring import mark_safe from django.utils.translation import gettext_lazy as _ from wagtail.blocks import RichTextBlock @@ -8,7 +9,6 @@ from hypha.apply.review.fields import ScoredAnswerField from hypha.apply.review.options import ( NA, - PRIVATE, RATE_CHOICE_NA, RATE_CHOICES, RATE_CHOICES_DICT, @@ -152,7 +152,7 @@ class Meta: def get_field_kwargs(self, struct_value): kwargs = super(VisibilityBlock, self).get_field_kwargs(struct_value) kwargs["choices"] = VISIBILITY.items() - kwargs["initial"] = PRIVATE + kwargs["initial"] = settings.REVIEW_VISIBILITY_DEFAULT kwargs["help_text"] = mark_safe( "
".join( [ diff --git a/hypha/settings/base.py b/hypha/settings/base.py index d8eabbd1c9..905c3d6dcd 100644 --- a/hypha/settings/base.py +++ b/hypha/settings/base.py @@ -144,6 +144,9 @@ # Possible values are: False, 1,2,3,… TRANSITION_AFTER_REVIEWS = env.bool("TRANSITION_AFTER_REVIEWS", False) +# Default visibility for reviews. +REVIEW_VISIBILITY_DEFAULT = env.str("REVIEW_VISIBILITY_DEFAULT", "private") + # Project settings.