Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Debian New Member Process
nm.debian.org
Commits
b435fe95
Commit
b435fe95
authored
Jun 03, 2016
by
Enrico Zini
Browse files
Use visit_perms to check if fd_comments are to be shown
parent
93155b8b
Changes
2
Hide whitespace changes
Inline
Side-by-side
process/templates/process/show.html
View file @
b435fe95
...
@@ -102,7 +102,7 @@
...
@@ -102,7 +102,7 @@
</td>
</td>
</tr>
</tr>
{% if
visitor.is_admin and process.fd_comment
%}
{% if
"fd_comments" in visit_perms
%}
<tr
id=
"view_fd_comment"
><th>
FD comments
</th><td>
{{process.fd_comment}}
</td></tr>
<tr
id=
"view_fd_comment"
><th>
FD comments
</th><td>
{{process.fd_comment}}
</td></tr>
{% endif %}
{% endif %}
...
...
process/tests/test_process_show.py
View file @
b435fe95
...
@@ -39,7 +39,7 @@ class TestProcessShow(ProcessFixtureMixin, TestCase):
...
@@ -39,7 +39,7 @@ class TestProcessShow(ProcessFixtureMixin, TestCase):
# Check page elements based on visit_perms
# Check page elements based on visit_perms
visit_perms
=
self
.
processes
.
app
.
permissions_of
(
self
.
visitor
)
visit_perms
=
self
.
processes
.
app
.
permissions_of
(
self
.
visitor
)
wanted
=
[]
wanted
=
[]
if
"fd_comment"
in
visit_perms
:
if
"fd_comment
s
"
in
visit_perms
:
wanted
.
append
(
"view_fd_comment"
)
wanted
.
append
(
"view_fd_comment"
)
if
"add_log"
in
visit_perms
:
if
"add_log"
in
visit_perms
:
wanted
+=
[
"log_public"
,
"log_private"
]
wanted
+=
[
"log_public"
,
"log_private"
]
...
@@ -59,6 +59,11 @@ class TestProcessShow(ProcessFixtureMixin, TestCase):
...
@@ -59,6 +59,11 @@ class TestProcessShow(ProcessFixtureMixin, TestCase):
pmodels
.
AMAssignment
.
objects
.
create
(
process
=
self
.
processes
.
app
,
am
=
self
.
ams
.
am
,
assigned_by
=
self
.
persons
[
"fd"
],
assigned_time
=
now
())
pmodels
.
AMAssignment
.
objects
.
create
(
process
=
self
.
processes
.
app
,
am
=
self
.
ams
.
am
,
assigned_by
=
self
.
persons
[
"fd"
],
assigned_time
=
now
())
self
.
tryVisitingWithPerms
(
set
())
self
.
tryVisitingWithPerms
(
set
())
def
test_fd_comments
(
self
):
self
.
tryVisitingWithPerms
(
set
([
"fd_comments"
]))
pmodels
.
AMAssignment
.
objects
.
create
(
process
=
self
.
processes
.
app
,
am
=
self
.
ams
.
am
,
assigned_by
=
self
.
persons
[
"fd"
],
assigned_time
=
now
())
self
.
tryVisitingWithPerms
(
set
([
"fd_comments"
]))
def
test_add_log
(
self
):
def
test_add_log
(
self
):
self
.
tryVisitingWithPerms
(
set
([
"add_log"
]))
self
.
tryVisitingWithPerms
(
set
([
"add_log"
]))
pmodels
.
AMAssignment
.
objects
.
create
(
process
=
self
.
processes
.
app
,
am
=
self
.
ams
.
am
,
assigned_by
=
self
.
persons
[
"fd"
],
assigned_time
=
now
())
pmodels
.
AMAssignment
.
objects
.
create
(
process
=
self
.
processes
.
app
,
am
=
self
.
ams
.
am
,
assigned_by
=
self
.
persons
[
"fd"
],
assigned_time
=
now
())
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment