Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hypha
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ots
hypha
Commits
20de87d8
Commit
20de87d8
authored
6 years ago
by
Todd Dembrey
Browse files
Options
Downloads
Patches
Plain Diff
Add comments block to the hidden fields
parent
b803602e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
opentech/apply/review/views.py
+5
-2
5 additions, 2 deletions
opentech/apply/review/views.py
with
5 additions
and
2 deletions
opentech/apply/review/views.py
+
5
−
2
View file @
20de87d8
...
...
@@ -9,7 +9,7 @@ from wagtail.core.blocks import RichTextBlock
from
opentech.apply.activity.messaging
import
messenger
,
MESSAGES
from
opentech.apply.funds.models
import
ApplicationSubmission
from
opentech.apply.review.blocks
import
RecommendationBlock
from
opentech.apply.review.blocks
import
RecommendationBlock
,
RecommendationCommentsBlock
from
opentech.apply.review.forms
import
ReviewModelForm
from
opentech.apply.stream_forms.models
import
BaseStreamForm
from
opentech.apply.users.decorators
import
staff_required
...
...
@@ -122,6 +122,9 @@ class ReviewListView(ListView):
self
.
queryset
=
self
.
model
.
objects
.
filter
(
submission
=
self
.
submission
,
is_draft
=
False
)
return
super
().
get_queryset
()
def
should_display
(
self
,
field
):
return
not
isinstance
(
field
.
block
,
(
RecommendationBlock
,
RecommendationCommentsBlock
,
RichTextBlock
))
def
get_context_data
(
self
,
**
kwargs
):
review_data
=
{}
...
...
@@ -148,7 +151,7 @@ class ReviewListView(ListView):
for
field_id
in
review
.
fields
:
field
=
review
.
field
(
field_id
)
data
=
review
.
data
(
field_id
)
if
not
isinstance
(
field
.
block
,
(
RecommendationBlock
,
RichTextBlock
)
):
if
self
.
should_display
(
field
):
question
=
field
.
value
[
'
field_label
'
]
review_data
.
setdefault
(
field
.
id
,
{
'
question
'
:
question
,
'
answers
'
:
[
''
]
*
responses
})
review_data
[
field
.
id
][
'
answers
'
][
i
]
=
field
.
block
.
render
(
None
,
{
'
data
'
:
data
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment