Skip to content

Commit

Permalink
correcting num_pledges endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
monaddle committed Nov 12, 2014
1 parent 7ce289a commit 3884d59
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,11 +523,11 @@ def get(self):
util.EnableCors(self)

WP_PLEDGES = 4099
VERSION_11_AND_UNDER = 11743
VERSION_12_AND_UNDER = 59009

count = memcache.get('TOTAL-PLEDGES')
if not count:
query = model.Pledge.all(keys_only=True).filter('model_version >', 11)
query = model.Pledge.all(keys_only=True).filter('model_version >', 12)
i = 0
while True:
result = query.fetch(1000)
Expand All @@ -536,7 +536,7 @@ def get(self):
break
cursor = query.cursor()
query.with_cursor(cursor)
count = i + WP_PLEDGES + VERSION_11_AND_UNDER
count = i + WP_PLEDGES + VERSION_12_AND_UNDER
memcache.set('TOTAL-PLEDGES', count, 120)

self.response.headers['Content-Type'] = 'application/json'
Expand Down

0 comments on commit 3884d59

Please sign in to comment.