Bug 916229 - proposing a patch to fix the bug.

Ah, one thing I forgot to say, since we open those cursors a lot (since it's the homepage) could you add a `try: .. finally` block that closes the cursor after you've made the queries? See https://docs.djangoproject.com/en/dev/topics/db/sql/#connections-and-cursors for an example at the bottom.