Commit c53d12b3 authored by Arkadiusz Hiler's avatar Arkadiusz Hiler

series: Use 'yesno' template filter for boolean conversion

Just use proper Python booleans and do the conversion in the template
using dedicated filter.
Signed-off-by: Arkadiusz Hiler's avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
parent a8385c88
......@@ -27,7 +27,7 @@ class SeriesListView(View):
def get(self, request, *args, **kwargs):
project = get_object_or_404(Project, linkname=kwargs['project'])
is_editable = 'true' if project.is_editable(request.user) else 'false'
is_editable = project.is_editable(request.user)
return render(request, 'patchwork/series-list.html', {
'project': project,
'is_editable': is_editable,
......@@ -48,7 +48,7 @@ class SeriesView(View):
.filter(revision=revision, patch=None) \
.order_by('test__name').select_related('test')
is_editable = 'true' if project.is_editable(request.user) else 'false'
is_editable = project.is_editable(request.user)
return render(request, 'patchwork/series.html', {
'series': series,
......
......@@ -42,7 +42,7 @@
, project: {
pk: {{ project.pk }},
name: '{{ project.linkname }}',
is_editable: {{ is_editable|default:"false" }},
is_editable: {{ is_editable|yesno:"true,false" }},
},
{% endif %}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment