Use mass-attach of project pictures, and only when they are actually used
This commit is contained in:
@@ -7,7 +7,7 @@ import werkzeug.exceptions as wz_exceptions
|
||||
|
||||
from pillar.auth import current_user as current_user
|
||||
from pillar.api.utils import str2id
|
||||
from pillar.web.utils import attach_project_pictures
|
||||
from pillar.web.utils import mass_attach_project_pictures
|
||||
import pillar.web.subquery
|
||||
from pillar.web.system_util import pillar_api
|
||||
from pillar.web.projects.routes import project_view
|
||||
@@ -36,8 +36,9 @@ def index():
|
||||
# TODO: add projections.
|
||||
projects = current_attract.attract_projects()
|
||||
|
||||
for project in projects['_items']:
|
||||
attach_project_pictures(project, api)
|
||||
if current_user.is_anonymous:
|
||||
# Headers are only shown in index_anon_left_column.pug
|
||||
mass_attach_project_pictures(projects['_items'], square=False, api=api)
|
||||
|
||||
projs_with_summaries = [
|
||||
(proj, current_attract.shot_manager.shot_status_summary(proj['_id']))
|
||||
|
Reference in New Issue
Block a user