Explorar el Código

[jobsub] Limit number of designs

Romain Rigaux hace 12 años
padre
commit
20e1ecce24
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      apps/jobsub/src/jobsub/views.py

+ 2 - 1
apps/jobsub/src/jobsub/views.py

@@ -45,6 +45,7 @@ from oozie.utils import model_to_dict, format_dict_field_values,\
 
 
 
 
 LOG = logging.getLogger(__name__)
 LOG = logging.getLogger(__name__)
+MAX_DESIGNS = 250
 
 
 
 
 def _list_designs(request, owner, name, order_by='-last_modified'):
 def _list_designs(request, owner, name, order_by='-last_modified'):
@@ -65,7 +66,7 @@ def _list_designs(request, owner, name, order_by='-last_modified'):
   data = data.order_by(order_by)
   data = data.order_by(order_by)
 
 
   designs = []
   designs = []
-  for doc in data:
+  for doc in data[:MAX_DESIGNS]:
     design = doc.content_object
     design = doc.content_object
 
 
     ko_design = {
     ko_design = {