Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Commits on Apr 25, 2015
  1. @Deimos

    AutoMod: fix bug with approving reported items

    Deimos authored
    An approve action should only trigger on a reported item if the rule was
    specifically looking for it being reported. Previously, any rule with an
    approve action could end up triggering on an item when it was re-checked
    due to a report.
Commits on Apr 24, 2015
  1. @MelissaCole

    Display gold expiration for users

    MelissaCole authored
    If users have the 'show gold expiration' preference checked, then how much
    gold they have remaining will be shown on their userpage to the public.
  2. @MelissaCole

    reddit_themes: pref_other_theme doesn't always exist

    MelissaCole authored
    This fixes a KeyError that occurs when pref_other_theme isn't passed in.
  3. @florenceyeun

    Search: Add link to enable NSFW results

    florenceyeun authored
    When the safe search feature is enabled, NSFW links and subreddits
    will not appear in search results unless the over18 preference has
    been set by the user.
    
    For easy access to the over18 preference, add a link to enable NSFW
    search results on the main search page and the subreddit search page.
    Clicking on the link will redirect to the /over18 confirmation page.
    The link will not appear if the over18 preference was already enabled.
  4. @JordanMilne

    Don't treat strings in `ObjectTemplate`s as `StringTemplate`s

    JordanMilne authored
    This was leading to strange behaviour like `<$>timesince</$>` in a
    random string field rending as `just now`. It might have been necessary
    when we were caching `JsonTemplate`s, but we don't anymore.
  5. @JordanMilne

    Import `wrapped` stuff in `conditional_websafe`, not at the top level

    JordanMilne authored
    Having the import here means we can't import anything from `filters`
    with a clean build environment. `wrapped` won't exist yet, and we need
    `scriptsafe_dumps` for the JS build!
  6. @JordanMilne

    Add `/user/me/*` catchall before plugin-defined routes

    JordanMilne authored
    This fixes an issue with `/user/me/snoo` since `/user/:name/snoo` is
    defined in `-gold`.
  7. @JordanMilne

    Throw out broken `Cookie` headers in `BaseController.__before__`

    JordanMilne authored
    This fixes an issue where we were parsing `request.cookies` before
    checking if the cookie header was even valid:
    https://github.com/reddit/reddit/blob/86a3d262f20c7ac457db089288925c88792e9b1e/r2/r2/controllers/reddit_base.py#L1477
    
    This lead to a lot of hard-to-track down issues like us ending up
    in `<Controller.post>` with inconsistent state due to `pre` aborting.
    
    Before we were throwing them out in `RedditController.pre`, but we
    need `request.cookies` in `MinimalController.pre` as well:
    https://github.com/reddit/reddit/blob/86a3d262f20c7ac457db089288925c88792e9b1e/r2/r2/controllers/reddit_base.py#L1099
    
    Since `RedditController.pre` uses `request.cookies` before calling
    `MinimalController.pre`, I took the easy route and put the header
    cleaning code in `BaseController.__before__`, before either `pre`
    gets run.
  8. @JordanMilne
Commits on Apr 23, 2015
  1. @MelissaCole

    Consolidate gold ad preferences into one

    MelissaCole authored
    This moves the 3 ad preferences (300x100, 300x250, and sponsors) into
    1 preference (hide ads) for simplicity.
  2. @kemitche

    OPTIONS_request_promo: Allow-Origin *

    kemitche authored
    Allow all origins to make CORS requests to POST_request_promo.
    Simplifies local testing of mobile web.
  3. @bsimpson63 @kemitche

    Send CORS headers with POST_request_promo response.

    bsimpson63 authored kemitche committed
  4. @xiongchiamiov

    Q&A sort: fix caching bug

    xiongchiamiov authored
    In certain cases, we'll try to load in comments for which we can't find a
    cached sort value.  When that happens, we calculate the value on-the-fly and
    then store it.
    
    When this happens, we've been pulling the comment without any of its extra
    attributes.  This is fine for most sorts, but for the Q&A sort, we look at more
    than just the ups and downs (notably, `author_id`).  Since we weren't getting
    these attributes, we'd run into an error when trying to use them.
    
    Now we fetch the extra data for comments when using the Q&A sort.
  5. @MelissaCole

    Fix header override when stylesheet doesn't exist

    MelissaCole authored
    With the reddit themes release, the default sr style and header overrides
    the subreddit style if there is no stylesheet (even if there is a header).
    This change considers a header as being part of the style and won't override
    the current sr style for the reason of there being no stylesheet. This header
    image can be disabled with the "show this subreddit's theme" toggle.
Commits on Apr 22, 2015
  1. @ThorArakis

    utils: Strip the www from a domain only if there are 3 parts

    ThorArakis authored
    Because www2 should be stripped from www2.foo.com but not from www2.com
  2. @xiongchiamiov

    UrlParser: enforce order on query parameters

    xiongchiamiov authored
    While most of the time two urls with identical query parameters in a different
    order are treated exactly the same by the receiving server, every now and then
    they're not.  Now we use `OrderedDict`s for storing the query params, allowing
    us to deal with those situations.
  3. @xiongchiamiov

    UrlParser: coerce values to strings in update_query()

    xiongchiamiov authored
    They'd always end up as strings eventually when you `unparse()`, but storing
    them as non-strings throws off `__eq__()`.
  4. @xiongchiamiov

    UrlParser: remove _url_updates

    xiongchiamiov authored
    While investigating one issue I got distracted by another issue with the
    newly-written `__eq__` method of `UrlParser`, which in turn got me frustrated
    with the `_url_updates` attribute.
    
    You see, after parsing a url into a `UrlParser`, we've been keeping the
    original url parameters in `_query_dict`, updates to it in `_url_updates`, and
    merging them together on `unparse()`.  At first glance, this seems like a
    reasonable thing to do.
    
    However, this was in reality a pretty weak guarantee.  The first time you call
    `unparse()`, `_query_dict` was being updated with the contents of
    `_url_updates`.  Additionally, it is very easy to accidentally modify the
    `_query_dict` object (`unparse()` was probably doing it on accident).
    
    A much better way to have a record of the original query string would be to
    keep a separate copy of it in a privatish attribute - as with `_orig_url` and
    `_orig_netloc`.  The good news is that I didn't find any place where we do in
    fact need that, so I just left it out.  But it would be easy to add in the
    future if necessary.
    
    Anyways, now there is just **one** dictionary of query parameters - one place
    to look when trying to determine the current state of the parsed url without
    turning it back into a string.
  5. @xiongchiamiov

    reddit themes: allow using of themes from 21-char subreddits

    xiongchiamiov authored
    We mistakenly misread the name-enforcement regex `subreddit_rx` to say that
    subreddit names can be a maximum of 20 characters, and so set the maximum
    length of the field for custom subreddit themes at 20.  The maximum length is
    actually 21, which means that a people have been prevented from using themes
    from certain subreddits.
  6. @ThorArakis
  7. @umbrae @spladug
Commits on Apr 21, 2015
  1. @powerlanguage @MelissaCole

    Update language and style for reddit themes.

    powerlanguage authored MelissaCole committed
  2. @MelissaCole

    Pull reddit themes in pref from wiki

    MelissaCole authored
    The featured reddit themes will be shown on the prefs page as a radio button
    with an `other` option. The wiki page holds the data for the tagline and image
    previews so that it can be updated without a code push.
  3. @MelissaCole

    Add .subreddits-page class to subreddit listing pages

    MelissaCole authored
    This adds .subreddits-page to /subreddits/mine and /subreddits/search
  4. @MelissaCole

    Gold: Add ability to override individual sr styles

    MelissaCole authored
    The individual subreddit style pref overrides the global (show custom
    styles) pref. If the subreddit style is disabled, the default reddit
    style will be displayed for that subreddit (which can be the default
    style they select or just none).
  5. @MelissaCole

    Stripe: Add charge.updated event type

    MelissaCole authored
    No further processing is needed for this type of event
  6. @MelissaCole
  7. @MelissaCole
  8. @MelissaCole
  9. @Deimos @MelissaCole

    Gold feature: Stylesheets everywhere

    Deimos authored MelissaCole committed
    This allows users to pick a stylesheet from a subreddit of their choosing and
    have it be applied to (most) pages on reddit where there isn't already a custom
    stylesheet.
  10. @florenceyeun

    Search: Remove extra SearchException handler

    florenceyeun authored
    `search_fail()` is already triggered from `_search()` and can be
    removed from `GET_search()`.
  11. @florenceyeun

    Search: Add subreddits results to search

    florenceyeun authored
    Make an extra search request for subreddit results, controlled by a
    feature flag.
  12. @florenceyeun

    Search: Remove unused elapsed_time from templates

    florenceyeun authored
    Preserve the calculated search `elapsed_time` in the listing model but
    otherwise remove template references.
  13. @florenceyeun

    Search: Log event for InvalidQuery

    florenceyeun authored
    Log a simple event when an InvalidQuery is handled on the search page.
  14. @florenceyeun

    Subreddit search: Test new rel1 relevancy

    florenceyeun authored
    Use rel1 relevancy when the subreddit_relevancy feature flag is
    enabled. Add activity as a sort option to access original relevancy.
Something went wrong with that request. Please try again.