If the query were just parentheses, like ")(",
l2cs.convert would return an empty string, causing
the subsequent search to fail. This moves the empty
query check later in the code to avoid that issue.
fixesreddit/reddit#618
Some threads are writing to the data buffer while we're trying to
iterate over it. This will cause some lost stats, but no more than we're
currently losing to the app dying when it hits the race condition.
This setup assumes the existence of a `test.ini` file. No current tests
mutate backend state, but that may happen in the future so don't make
your test.ini point at production!
* Modify authorize/*.py to add @export and __all__
* Do a style sweep on authorize/* to clear up a few style issues
* add unit test for authorize/* that tests non-DB classes and imports
*
The lounge is too popular! update_gold_users is crashing taking too long
to update the SRMember:contributor rel when users' gold expire. This
change makes it so that we don't actually need to maintain the rel to
maintain proper access control for the lounge.
This should help resolve a circular import wherein "import jsonresponse"
triggers "from r2.lib.pages.things import wrap_links" in jsonresponse.py,
which triggers "from pages import *" in r2/lib/pages/__init__.py, which
further triggers "from r2.lib.jsonresponse import json_respond" in pages.py
This adds three attributes to vote arrows:
* role="button" is part of ARIA and tells user agents that even though
the vote arrow is a div, it's actually meant to be a button.
* aria-label, another part of ARIA, this tells user agents what to
call the newly buttonized.
* tabindex, this makes the buttons able to receive keyboard focus so you
tab through the document.
This should allow us to collect more information on where lingering
transactions come from.
Note: this uses an undocumented feature of psycopg2 connection strings
to get around a limitation in the version of psycopg2 we're on. This is
resolved as of v2.4.3 of psycopg2.
http://archives.postgresql.org/psycopg/2011-11/msg00020.php
This fixes a minor self-XSS in the Wiki editor for config/stylesheet and
should protect us against similar issues happening again in the future.
Thanks to @nealpoole for the disclosure.