Commit Graph

2386 Commits

Author SHA1 Message Date
Neil Williams
438a0d7357 ErrorController: Clean up imports. 2013-01-03 11:05:53 -08:00
Neil Williams
60d207b7c5 reddit_base: Fix babel.core import position.
Babel is not a stdlib.
2013-01-03 11:05:53 -08:00
Neil Williams
4172c7182b ratelimit_agent: Fix key expiring too soon.
This caused occasional NOT_FOUNDs on the incr when we were unlucky to
have it expire between the add and the incr.
2013-01-03 11:05:53 -08:00
Roger Ostrander
6d6c0c57e9 LiveDict backing for Zookeeper 2013-01-02 17:06:02 -08:00
Neil Williams
f1f7f36b32 tests: Fix up tests for r2.lib.tracking. 2013-01-02 15:27:11 -08:00
Neil Williams
49f41715da setup.cfg: Remove cruft. 2013-01-02 15:27:11 -08:00
Neil Williams
3e73f5769c setup.py: Remove unused and potentially confusing commands. 2013-01-02 15:27:11 -08:00
Neil Williams
54223e8825 Make it possible to run all automated tests via nosetests.
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!
2013-01-02 15:27:11 -08:00
Neil Williams
1c30e9c36d db_manager: postgres:// -> postgresql://
The old scheme is deprecated.
2013-01-02 15:27:11 -08:00
Keith Mitchell
c322a3d8a7 pylintrc: Add inline comment on disable line 2012-12-31 14:08:12 -07:00
Kevin Kress
9b83d48eba Modify authorize/* code to use new @export syntax
* 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
*
2012-12-31 14:08:07 -07:00
Kevin Kress
288b9be012 add @export syntax for handling __all__
This adds a decorator that checks for __all__ and then exports decorated
functions and classes to it.
2012-12-31 14:08:01 -07:00
Kevin Kress
cd9318d2b0 Add a pylintrc for reddit's needs
Allows running pylint --rcfile pylintrc r2/ to get a list of potential
problems.
2012-12-31 14:07:55 -07:00
Bryce Boe
deb857f686 Show hidden submissions in moderator listings. 2012-12-31 14:07:45 -07:00
Ricky Ramirez
be5fb02d14 template_helpers: Point to /about/team for info on admins. 2012-12-28 11:28:26 -08:00
Neil Williams
bd03654eaf Revert "Apply a bandaid for _dirties being stuck in memcached."
This reverts commit a452422057fdcbeafe26fcbbff527bcc2be37d3d.
This reverts commit bac38fe3a41cd09643b37bad947f3b3a70d5784d.
2012-12-28 11:12:23 -08:00
Neil Williams
dda3ff1539 Make /r/lounge is_contributor not rely on overbloated rel.
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.
2012-12-27 14:16:49 -08:00
Neil Williams
55a4968209 Apply a bandaid for _dirties being stuck in memcached. 2012-12-27 14:16:49 -08:00
Neil Williams
4fda0f9f4a plugins: Add hook for watching Thing commits. 2012-12-27 14:16:48 -08:00
Neil Williams
76594cdeb6 Refactor and reorganize email canonicalization; add some tests.
The email_attrs thing wasn't actually being used (`if False`) and so
I've removed it in the process.
2012-12-27 14:16:28 -08:00
Ricky Ramirez
9b66333c2e Remove "edit this page" tag for embedded trac wiki pages.
The trac wiki is now deprecated and content should be migrated to the new
integrated wiki.
2012-12-26 14:51:17 -08:00
Neil Williams
ac118cebd8 Be more thorough in sanitizing for add_request_info. 2012-12-26 14:06:51 -08:00
Neil Williams
bfa457c67f Fix bad ad URLs causing mistargeting.
c.site.path = /r/whatever/
c.site.name = whatever

"r/%s/" % c.site.name = "r//r/whatever//"
2012-12-21 11:29:02 -08:00
Roger Ostrander
6d21636a93 Fully rendered sidebars now at /r/foo/about/sidebar 2012-12-20 14:58:50 -08:00
Keith Mitchell
8df185c42b validators: Move from controllers to lib 2012-12-20 13:40:20 -08:00
Keith Mitchell
87b41c9d4b errors.py: Move from controllers -> lib
Since these are not directly related to controllers.
2012-12-20 13:40:14 -08:00
Keith Mitchell
7408668d18 Import proxyurl from the correct place 2012-12-20 13:40:09 -08:00
Keith Mitchell
4a8ebf411c Remove underused json_respond
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
2012-12-20 13:40:00 -08:00
Keith Mitchell
6d6a0a1d08 reddit_base: Automated whitespace changes 2012-12-20 13:39:42 -08:00
Keith Mitchell
15817179d5 reddit_base: clean up imports 2012-12-20 13:39:36 -08:00
Neil Williams
d253daa907 Clean up and reorganize traffic-tracking code. 2012-12-19 15:26:02 -08:00
Ricky Ramirez
efee207552 Cleanup template_helpers.
Remove extra whitespace.
Fix typo hotname -> hostname.
2012-12-18 12:06:20 -08:00
Neil Williams
0e3c0a19a4 Allow ratelimited useragents to be a little more bursty.
This will allow ratelimited agents like Googlebot a little more leeway
when it comes to the API ratelimits.
2012-12-18 12:06:20 -08:00
Neil Williams
86e4532140 Remove extraneous outline from compact view as well. 2012-12-18 12:06:10 -08:00
Logan Hanks
c053d82883 Parse dsn param to get key for pg stats. 2012-12-17 13:27:15 -08:00
Pavel
46070df795 Remove outline added to vote arrows by accessibility patch. 2012-12-17 12:56:54 -08:00
Neil Williams
2ddfab7e69 Accessibility: Make vote arrows into buttons.
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.
2012-12-17 12:23:25 -08:00
Neil Williams
25b5683222 Accessibility: Remove meaningless alt text.
It just gets in the way of screen readers.
2012-12-17 12:23:25 -08:00
Neil Williams
2beabad0cc Accessibility: Add ARIA landmarks.
These are the modern equivalent of the "jump to content" link.
2012-12-17 12:23:25 -08:00
Neil Williams
11bda59611 Set PostgreSQL application_name metadata.
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
2012-12-17 12:23:25 -08:00
Neil Williams
102ef36b8b Entity-escape error response payload JSON.
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.
2012-12-17 11:30:41 -08:00
Neil Williams
a74f609eee /comments/gilded: Set c.profilepage = True for "in subreddit" etc. 2012-12-14 15:33:28 -08:00
Logan Hanks
9379b08c9a Change CommentTree CF's key from a tuple of bigints to a tuple of longs. 2012-12-14 13:05:47 -08:00
Neil Williams
e028c35676 Add a new listing of gilded comments. 2012-12-14 12:52:36 -08:00
Neil Williams
c91374acc4 db_manager: Don't try writing to slaves for rels. 2012-12-14 12:52:36 -08:00
Neil Williams
eebb529e2c db_manager: PEP-8 Cleanups. 2012-12-14 12:52:36 -08:00
Neil Williams
2ef7985618 Revert "queries: Move /r/all/comments to new query cache (try 3)."
This reverts commit 13497f6f08.
2012-12-14 12:52:35 -08:00
Neil Williams
d6924c8bcc rss: Don't render invalid thumbnails for built-in sprited thumbs. 2012-12-14 11:57:47 -08:00
Neil Williams
06742f69b7 rss: Add atom:link rel="self" to RSS feeds.
This is recommended by the W3C RSS feed validator:

http://validator.w3.org/feed/docs/warning/MissingAtomSelfLink.html
2012-12-14 11:57:41 -08:00
Max Goodman
8ba1ef41d6 Update ToC styling to match new wrapper class. 2012-12-13 13:22:14 -08:00