Commits on Sep 22, 2016
  1. UserRelManager.add(): catch CreationError

    The add() function uses a get() at the beginning to avoid creating
    duplicate relations, but concurrent requests can get past this point and
    will throw a CreationError when the rel is committed. This handles that
    case as well and returns None, the same as if the initial get()
    determines that the rel already exists.
    Deimos committed Sep 22, 2016
  2. VWikiPage: catch ValueError from bad hex string

    Currently, passing an invalid hex string as a wiki revision ID will
    cause a 500, due to an unhandled ValueError. This catches it so that a
    404 will be returned instead, similar to incorrect (but valid hex)
    revision IDs.
    Deimos committed Sep 21, 2016
  3. Don't store private IP addresses

    Storing a private IP address for a user indicates that they're using an
    internal "app" (mweb, modmail, etc.) that isn't passing along the user's
    actual IP correctly.
    Storing these IPs is not useful at all, so this commit checks if an IP
    is private before storing it. However, getting to that point signals an
    issue that needs to be resolved, so this will send a graphite event that
    we can alert on to know that we have an app that needs to be adjusted.
    Deimos committed Sep 14, 2016
  4. LinksByUrlAndSubreddit: truncate very long urls

    There are a few urls in the system that are extremely long (100,000+
    chars). Cassandra's maximum key length is 64kb, so the whole url can't
    be used as a key for these. This truncates the url at 65,000 characters
    to prevent that from happening.
    We should probably also implement a maximum url length, but this
    prevents crashes from the pre-existing urls longer than that.
    Deimos committed Sep 13, 2016
  5. utils.domain(): instead of findall()

    Using findall is very slow on large urls, and completely unnecessary
    since we only want the first match anyway.
    Deimos committed Sep 13, 2016
  6. Fix empty locale errors in format_number/percent

    The previous attempt at this fix (296f378) still did not resolve the
    This commit falls back to g.locale if c.locale is not set, instead of
    trying to fall back to the LC_NUMERIC env variable.
    Deimos committed Sep 13, 2016
  7. Revert "Fix empty locale errors in format_number/percent"

    This reverts commit 296f378.
    Deimos committed Sep 13, 2016
  8. POST_flaircsv: handle blank flair_csv param

    This endpoint is currently crashing if nothing is supplied for the
    flair_csv param. Returning immediately seems reasonable - no flair
    updates requested, so there's nothing to do.
    Deimos committed Aug 30, 2016
  9. Remove redundant /jobs routing.

    This line duplicates / shadows a previous /jobs redirect. You can tell it's not
    being used by visiting /jobs on prod.
    wting committed Sep 22, 2016
  10. Vagrantfile: remove adzerk plugin (#1694)

    zeantsoi committed on GitHub Sep 22, 2016
Commits on Sep 21, 2016
  1. Templated: Remove unpublished timer in _render()

    This was only used in the timing display bar thing, but wasn't very useful.
    bsimpson63 committed Sep 16, 2016
  2. Templated: Remove timer for g.timed_templates

    These timings were never published and sort of are duplicates of the
    "render.RENDER_CLASS_NAME.cached" timer in Templated._render.
    bsimpson63 committed Sep 16, 2016
Commits on Sep 20, 2016
  1. FastlyCdnProvider: Implement get_client_ip and get_client_location

    For now these depend on something setting the old CloudFlare headers
    "CF-Connecting-IP" and "CF-IPCountry".
    bsimpson63 committed Sep 12, 2016
  2. Add FastlyCdnProvider

    MelissaCole committed with bsimpson63 May 24, 2016
Commits on Sep 16, 2016
Commits on Sep 14, 2016
  1. OAuth2AccessController: return 403 if g.disallow_db_writes

    Some pools are read-only by setting g.disallow_db_writes True. If
    a write is attempted there can be an exception. Instead of handling
    the exception we should just immediately abort in OAuth2AccessController
    because it will always need to write.
    bsimpson63 committed Sep 14, 2016
  2. ThingJsonTemplate: Remove attributes only for Link and Comment

    Link and Comment are now handled by the ThingTemplate class so these
    special attribute handlers aren't needed.
    bsimpson63 committed Sep 8, 2016
  3. LinkJsonTemplate: fixups

    bsimpson63 committed Sep 14, 2016
  4. CommentJsonTemplate: pull some attributes out into methods

    These attributes will be shared with LinkJsonTemplate
    bsimpson63 committed Sep 8, 2016
  5. Remove donate plugin.

    kjoconnor committed Sep 13, 2016
Commits on Sep 13, 2016
  1. Ensure /click endpoint doesn't modify destination urls

    Omitting `keep_blank_values` was dropping blank query parameters.
    Furthermore, converting the output of `parse_qsl` to a dictionary
    was unnecessarily modifying the order of parameters since dicts
    are not ordered. Fortunately `urllib.urlencode` also accepts a
    sequence of two-element tuples and the order of parameters in
    the encoded string will match the order of parameter tuples in the
    dwick committed Nov 30, 2015
Commits on Sep 12, 2016
  1. Change name to archived_slow to indicate subreddit lookup

    Also replace all uses of the old "archived" property with archived_slow
    or is_archived if the subreddit is available.
    bsimpson63 committed Sep 7, 2016
  2. Link.sort_if_suggested: Take optional sr parameter

    This lets us skip the subreddit_slow call if we already have the subreddit.
    Pass the parameter in LinkJsonTemplate.
    bsimpson63 committed Sep 7, 2016
  3. Comment: Add is_archived() to skip subreddit lookup when possible

    Use this method in Comment.add_props when we already have the subreddit
    bsimpson63 committed Sep 7, 2016
  4. Link: Add is_archived() to skip subreddit lookup when possible

    Use this method in Link.add_props when we already have the subreddit
    bsimpson63 committed Sep 7, 2016
  5. Link: Rename to can_comment_slow

    This calls out the fact that there's an underlying subreddit_slow
    bsimpson63 committed Sep 7, 2016
  6. Link.archived/can_comment: Always use subreddit_slow

    There will never be a "subreddit" attribute already on the link.
    That only gets added to Wrapped Link objects, and even if we called
    wrapped_link.archived we'd fall through to Link.archived which no longer
    has access to the "subreddit" attribute.
    bsimpson63 committed Sep 7, 2016