浏览代码

Remove unneded DB access

Marcos Dumay de Medeiros 9 年之前
父节点
当前提交
6db85cf40f
共有 1 个文件被更改,包括 0 次插入5 次删除
  1. 0 5
      src/rapid/views.py

+ 0 - 5
src/rapid/views.py

@@ -214,11 +214,6 @@ class ListView(generic.list.ListView):
         ordering = request.GET.get('order', default_ordering)
         offset = (page - 1) * self.registers_per_page
         self.object_list = object_list[offset: offset + self.registers_per_page]
-        if len(self.object_list) > 0:
-            context['has_objects'] = True
-            context['first_object'] = self.object_list[0]
-        else:
-            context['has_objects'] = False
         context[self.get_context_object_name(object_list)] = object_list
         context['object_list'] = object_list
         context = self.get_context_data(**context)