diff --git a/qgis-app/base/views/processing_view.py b/qgis-app/base/views/processing_view.py index 8f2ff97d..bddb4fb5 100644 --- a/qgis-app/base/views/processing_view.py +++ b/qgis-app/base/views/processing_view.py @@ -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 diff --git a/qgis-app/styles/tests/test_views.py b/qgis-app/styles/tests/test_views.py index 35a1cbac..48d1b7fc 100644 --- a/qgis-app/styles/tests/test_views.py +++ b/qgis-app/styles/tests/test_views.py @@ -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(), + ['staff@email.com'] + ) + # style should be in Waiting Review url = reverse("style_unapproved") self.response = self.client.get(url) diff --git a/qgis-app/templates/base/review.html b/qgis-app/templates/base/review.html index 9c843541..07b29c91 100644 --- a/qgis-app/templates/base/review.html +++ b/qgis-app/templates/base/review.html @@ -65,7 +65,7 @@

{{ object_detail.name }} in review

{% endwith %} {% endif %} - {% if user.is_staff %} + {% if user.is_staff or is_style_manager %}
{% csrf_token %}
Approval