Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show review form for style managers #355

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading