mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
Added can_view_vouchers permission
This commit is contained in:
@@ -87,7 +87,7 @@
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if request.eventperm.can_change_vouchers %}
|
||||
{% if request.eventperm.can_view_vouchers %}
|
||||
<li>
|
||||
<a href="{% url 'control:event.vouchers' organizer=request.event.organizer.slug event=request.event.slug %}"
|
||||
{% if url_name == "event.vouchers" %}class="active"{% endif %}>
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<th>{% trans "View orders" %}</th>
|
||||
<th>{% trans "Change orders" %}</th>
|
||||
<th>{% trans "Change permissions" %}</th>
|
||||
<th>{% trans "View vouchers" %}</th>
|
||||
<th>{% trans "Change vouchers" %}</th>
|
||||
<th>{% trans "Delete" %}</th>
|
||||
</tr>
|
||||
@@ -31,6 +32,7 @@
|
||||
<td>{{ form.can_view_orders }}</td>
|
||||
<td>{{ form.can_change_orders }}</td>
|
||||
<td>{{ form.can_change_permissions }}</td>
|
||||
<td>{{ form.can_view_vouchers }}</td>
|
||||
<td>{{ form.can_change_vouchers }}</td>
|
||||
<td>{{ form.DELETE }}</td>
|
||||
</tr>
|
||||
@@ -49,6 +51,7 @@
|
||||
<td>{{ add_form.can_change_orders }}</td>
|
||||
<td>{{ add_form.can_change_permissions }}</td>
|
||||
<td>{{ add_form.can_change_vouchers }}</td>
|
||||
<td>{{ add_form.can_view_vouchers }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -445,7 +445,7 @@ class EventPermissionForm(I18nModelForm):
|
||||
model = EventPermission
|
||||
fields = (
|
||||
'can_change_settings', 'can_change_items', 'can_change_permissions', 'can_view_orders',
|
||||
'can_change_orders', 'can_change_vouchers'
|
||||
'can_change_orders', 'can_view_vouchers', 'can_change_vouchers'
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class VoucherList(EventPermissionRequiredMixin, ListView):
|
||||
context_object_name = 'vouchers'
|
||||
paginate_by = 30
|
||||
template_name = 'pretixcontrol/vouchers/index.html'
|
||||
permission = 'can_change_vouchers'
|
||||
permission = 'can_view_vouchers'
|
||||
|
||||
def get_queryset(self):
|
||||
qs = self.request.event.vouchers.all().select_related('item', 'variation')
|
||||
@@ -90,7 +90,7 @@ class VoucherList(EventPermissionRequiredMixin, ListView):
|
||||
|
||||
class VoucherTags(EventPermissionRequiredMixin, TemplateView):
|
||||
template_name = 'pretixcontrol/vouchers/tags.html'
|
||||
permission = 'can_change_vouchers'
|
||||
permission = 'can_view_vouchers'
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
ctx = super().get_context_data(**kwargs)
|
||||
|
||||
Reference in New Issue
Block a user