Skip to content
Snippets Groups Projects
Unverified Commit 681e0353 authored by Fredrik Jonsson's avatar Fredrik Jonsson Committed by GitHub
Browse files

Merge pull request #1714 from OpenTechFund/enhancement/comment-visibility-default-for-staff

Set default visibility to team for staff and to applicant for everyon…
parents 8ca4d958 e8e12f9f
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,8 @@ class CommentForm(forms.ModelForm):
self.allowed_visibility = self._meta.model.visibility_for(user)
self.visibility_choices = self._meta.model.visibility_choices_for(user)
visibility = self.fields['visibility']
visibility.initial = self.visibility_choices[0]
# Set default visibility to "team" for staff and to "applicant" for everyone else.
visibility.initial = self.visibility_choices[1] if user.is_apply_staff else self.visibility_choices[0]
if len(self.visibility_choices) > 1:
visibility.choices = self.visibility_choices
visibility.help_text = mark_safe('<br>'.join(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment