Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
ListingContentGenerator: call static.set() only once for first page
Browse files Browse the repository at this point in the history
For example, for the IndexContentGenerator, this makes only '/', instead
of both '/' and '/page/1'.
  • Loading branch information
rctay authored and Nick Johnson committed Feb 3, 2011
1 parent 5cebaac commit 3db3c0d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,8 @@ def generate_resource(cls, post, resource, pagenum=1, start_ts=None):
rendered = utils.render_template("listing.html", template_vals)

path_args['pagenum'] = pagenum
static.set(cls.path % path_args, rendered, config.html_mime_type)
if pagenum == 1:
static.set(cls.first_page_path % path_args, rendered,
config.html_mime_type)
path = cls.first_page_path if pagenum == 1 else cls.path
static.set(path % path_args, rendered, config.html_mime_type)

if more_posts:
deferred.defer(cls.generate_resource, None, resource, pagenum + 1,
Expand Down

0 comments on commit 3db3c0d

Please sign in to comment.