Skip to content

Commit

Permalink
Show review form for style managers (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix authored Feb 6, 2024
1 parent 179093c commit 998e0b5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions qgis-app/base/views/processing_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ def get_context_data(self, **kwargs):
context["reviewer"] = reviewer
if user.is_staff or is_resources_manager(user):
context["form"] = ResourceBaseReviewForm(resource_name=self.resource_name)
context["is_style_manager"] = is_resources_manager(user)
if self.is_3d_model:
context["url_viewer"] = "%s_viewer" % self.resource_name_url_base
return context
Expand Down
7 changes: 7 additions & 0 deletions qgis-app/styles/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ def test_upload_xml_file(self):
},
)
self.assertEqual(self.response.status_code, 200)

# Should send email to style managers
self.assertEqual(
mail.outbox[0].recipients(),
['[email protected]']
)

# style should be in Waiting Review
url = reverse("style_unapproved")
self.response = self.client.get(url)
Expand Down
2 changes: 1 addition & 1 deletion qgis-app/templates/base/review.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h3>{{ object_detail.name }} <small>in review</small></h3>
{% endwith %}
{% endif %}

{% if user.is_staff %}
{% if user.is_staff or is_style_manager %}
<form method="post" action="{% url url_review pk=object_detail.id %}">{% csrf_token %}
<dt>Approval</dt>
<dd>
Expand Down

0 comments on commit 998e0b5

Please sign in to comment.