From 9b315a7cf43a7ebbfa476179393138c54669d4f9 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Wed, 9 Mar 2016 14:25:43 -0400 Subject: [PATCH] Simple list to tupple and queryset count optimizations. --- mayan/apps/sources/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mayan/apps/sources/views.py b/mayan/apps/sources/views.py index 74d008be4d..56d3174533 100644 --- a/mayan/apps/sources/views.py +++ b/mayan/apps/sources/views.py @@ -74,10 +74,10 @@ class UploadBaseView(MultiFormView): def get_tab_link_for_source(source, document=None): if document: view = 'sources:upload_version' - args = ['"{}"'.format(document.pk), '"{}"'.format(source.pk)] + args = ('"{}"'.format(document.pk), '"{}"'.format(source.pk),) else: view = 'sources:upload_interactive' - args = ['"{}"'.format(source.pk)] + args = ('"{}"'.format(source.pk),) return Link( text=source.label, @@ -123,7 +123,7 @@ class UploadBaseView(MultiFormView): enabled=True ).select_subclasses().first() - if InteractiveSource.objects.filter(enabled=True).count() == 0: + if not InteractiveSource.objects.filter(enabled=True).exists(): messages.error( request, _(