Commit Graph

1582 Commits

Author SHA1 Message Date
Logan Hanks
fe13fd2114 Allow anyone to fetch a subreddit's flair. 2012-07-31 15:30:01 -07:00
Neil Williams
3457860b95 Don't count automatic subreddits against subscription limits.
When getting a list of user subreddits, we'll check if they're
subscribed to any automatic subreddits and remove them from the mix
before doing the random selection. Then they'll be added back in. This
is important to ensure that maintenance announcements aren't missed by
users because the announcement wasn't in their subset of subscriptions.

On reddit.com the automatic subreddits are /r/blog and /r/announcements.
2012-07-31 15:30:01 -07:00
Neil Williams
ab13e13170 traffic: Change top_last_month to sort by pageviews.
We generally use total pageviews more than uniques, so this is a more
meaningful metric to sort by.
2012-07-31 15:30:01 -07:00
Neil Williams
aa268840fa Apply domain shame-bans to toolbar framing.
Some evil people are using the toolbar URLs to spam their links and then
framebusting to ditch the toolbar. This patch makes it so that if the
framed URL is on a shame-banned domain, the framing will abort and
return a 404.
2012-07-30 12:28:18 -07:00
Max Goodman
482e8644d8 Fire a pixel for UI flow tracking of sub/unsubscribe.
This will allow us to collect information about how users found
subreddits that they subscribe to. We can use this information to test
the effectiveness of new ways of discovering and subscribing to
subreddits.

Specifically, when the subscribe button is clicked, for the current page
and previous page: the URL, referrer URL, and the type of UI element
clicked are sent. We'll use this to answer questions like:

 * "did clicking on gizmo A lead to users subscribing to subreddit B?"
 * "why did we see a spike in subscriptions to subreddit X today?"
2012-07-27 17:25:04 -07:00
Max Goodman
39e3a81c0a Include underscore.js. 2012-07-27 17:23:57 -07:00
Max Goodman
08eb0dacdd Make organic box sponsored link help translatable. 2012-07-27 17:23:57 -07:00
Max Goodman
eb1ccbcd2c Fix indentation. 2012-07-27 17:23:57 -07:00
Max Goodman
9fb5bf4ead » > ›. 2012-07-27 17:23:57 -07:00
Max Goodman
d3866c2ee6 Fix spelling and grammar in help box. 2012-07-27 17:23:57 -07:00
Max Goodman
7416c8379b Style help box so "close help" has the same font size as "what's this". 2012-07-27 17:23:57 -07:00
Max Goodman
da309ce65d Move "close help" link to bottom right corner to match "what's this". 2012-07-27 17:23:57 -07:00
Max Goodman
1c73304fe7 Remove unused jury duty organic box help. 2012-07-27 17:23:56 -07:00
Max Goodman
cd845733d2 s/reddits/rules in the footer. 2012-07-27 17:23:56 -07:00
Neil Williams
760acab7a4 Hide OTP prompt on /adminon when irrelevant.
If the user doesn't have an OTP secret and an OTP isn't required for
turning on admin mode, we'll just hide the prompt to avoid confusion.
2012-07-26 14:05:56 -07:00
shlurbee
5d67249d60 Make sr discovery links respect gold user preferences
Subreddit discovery links are basically sponsored links, so they shouldn't
appear if gold users have sponsored links turned off
2012-07-26 13:57:01 -07:00
Keith Mitchell
a2f7a90ddc Mis-merged to opensource 2012-07-26 13:48:58 -07:00
Max Goodman
d7ca88c2e5 Remove unused organic_links JS index. 2012-07-26 13:44:51 -07:00
Max Goodman
d433cb2970 Remove production pixel URL from example.ini. 2012-07-26 13:44:45 -07:00
bsimpson63
1fe22a1477 Reorganize delete and ban. 2012-07-26 13:44:29 -07:00
bsimpson63
03d207a656 Small cleanup in admintools.spam. 2012-07-26 13:43:00 -07:00
Keith Mitchell
13243bae17 Filter out non-existent subreddits from facets 2012-07-26 13:42:52 -07:00
bsimpson63
3712464798 Add before/after support for Details. 2012-07-25 17:25:51 -04:00
bsimpson63
a552bc858d Non-wrapped things deserve to be counted too. 2012-07-25 17:25:42 -04:00
bsimpson63
bd385dcc96 SimpleBuilder operates on a list of names, no lookups of Things. 2012-07-25 17:25:33 -04:00
bsimpson63
8a14c73ae0 fix typo in promote.campaign_is_live 2012-07-25 17:25:20 -04:00
bsimpson63
6ab04170c5 is_live_on_sr is more strict 2012-07-25 17:25:12 -04:00
shlurbee
69b6a327be Fix traffic display for SR discovery promos
The "Read from PromoCampaign things" change broke the code that causes the
traffic display to show the past month by default if a promoted link has
no campaigns.

This change fixes a bug where clicking on "traffic" on one of the subreddit
discovery spotlight links caused a 500 error.

See: 273c548c7d386126152e96b2bfde1eed2c4f18aa
2012-07-25 17:25:03 -04:00
shlurbee
2ec1e7e69d Error handling in promote.get_scheduled
Aggressively catches and logs exceptions inside the campaign loop in
get_scheduled. This change will allow make_daily_promotions to skip over
campaigns with corrupt data and still launch the others.

Note: We might want to consider passing the list of errored campaigns
back up to the calling function so they can be handled more noisily there.
2012-07-25 17:24:53 -04:00
Neil Williams
cbb072c75b Move verification email and password reset tokens into Cassandra.
In memcached there is a chance of the keys being evicted before their
time runs out. We can mitigate this by adding more memcaches, but that
has other downsides (such as increased risk of failure).
2012-07-24 15:46:38 -07:00
Neil Williams
7560c53464 Clean up minor formatting nitpicks in token.py. 2012-07-24 15:46:32 -07:00
Neil Williams
c8ea3ce9fa Refactor/rename OAuth2 token model so we can reuse it.
The OAuth2 Cassandra models are a perfect fit for other places in the
app that need randomly generated tokens.
2012-07-24 15:46:32 -07:00
Neil Williams
2f37f2604d tdb_cassandra: Let pycassa serialize timestamp when validated.
Pycassa will do its own marshalling when columns have validators
specified in the C* metadata.  We need to disable our own marshalling
when we know Pycassa will take care of it. This is already taken care of
in the general case, but timestamps are handled somewhat uniquely.
2012-07-24 15:46:32 -07:00
Neil Williams
1db68ce6b1 Require two-factor authentication to enable admin mode.
This feature can be disabled with the new ini setting
`disable_admin_otp`.
2012-07-23 15:59:17 -07:00
Neil Williams
8dfd73b195 Add framework for RFC-6238: Time-Based One Time Password Algorithm.
This provides a system for two-factor authentication, using a compliant
OTP-generator such as Google Authenticator. The framework includes a
validator for use on API calls needing authentication as well as a UI
for provisioning/resetting your secret key. A secure cookie may be
generated to effectively turn the user's browser into a temporary
authentication factor.

This feature is currently limited to admins only until full-site SSL is
available.
2012-07-23 15:59:17 -07:00
Neil Williams
529df1b13b reddit_base: Add support for Secure and HTTP-Only cookies. 2012-07-23 15:59:17 -07:00
Neil Williams
4169226735 Make profiling transparent and aggregatable.
If the config variable profile_directory is set, ProfilingMiddleware
will be added to the WSGI stack. The middleware will generate a file in
the specified directory on each request containing the contents of that
request's profile.
2012-07-23 18:57:00 -04:00
bsimpson63
283c26e2c0 Messages: Set after parameter to oldest visible message. 2012-07-23 18:57:00 -04:00
shlurbee
e48253065d Read from PromoCampaign things.
The code has already been dual-writing to PromoCampaign Things. This change
begins reading from Things while still writing to both Things and the link
attributes in case we need to roll back.
2012-07-23 18:57:00 -04:00
shlurbee
db5260f9ba Default end_date in PromotionWeights.bid_history
Makes the behavior match that of PromoteDates.bid_history, which sets the
end_date to today if it's not given as a parameter.

This fixes a bug where the function raised an error if the optional parameter
end_date wasn't provided.
2012-07-23 11:59:34 -07:00
shlurbee
9fa07d98a0 Always record trans_id in PromoCampaign things
Gets rid of default values so a data attribute will be saved even when trans_id
is zero. This change will make it possible to query for unpaid campaigns.

Also gets rid of payment state and makes sure the transaction id is preserved
even if the promoted link is rejected because this lets us link the campaign
to the refund in the promo log.
2012-07-23 11:59:10 -07:00
Neil Williams
bf2d80eec6 traffic: Reinstate averages in weekday summary.
In the previous system, the weekday summary showed the average traffic
for each day-of-week over the day interval range. The new system was
just showing the latest week's data.
2012-07-20 11:05:17 -07:00
bsimpson63
d140e00bcd Allow filtering of modactions by deleted users. 2012-07-20 11:05:17 -07:00
Max Goodman
e2ca4f3d03 Shorten recent clicks cookie to at most 5 elements. 2012-07-19 16:25:55 -07:00
Max Goodman
bcbba69a7e Simplify handling/mangling of should_compile special case.
or: How I Learned to Stop Worrying and Love the Mangling.
2012-07-19 16:25:55 -07:00
Keith Mitchell
07af98ff4f Make each of the JS files individually responsible
Make will still only build once
2012-07-19 16:25:55 -07:00
Neil Williams
149567a797 Turn off bucket validation to minimize S3 permissions.
boto attempts to validate the bucket when calling get_bucket by doing a
LIST with zero desired items. By turning off validate we can reduce the
permissions.
2012-07-19 16:17:59 -07:00
bsimpson63
e12dbdd046 Handle underscores in subreddit names in roadblocks. 2012-07-18 19:00:50 -04:00
bsimpson63
52db26df93 Handle promotions with 0 clicks. 2012-07-18 14:48:36 -04:00
shlurbee
b5812e6fa5 Check for valid campaign when fetching bid history
Occasional rogue promotion weights were causing /promoted/graph to fail. We
should figure out how those weights are being created in the first place, but
for now just check to make sure a campaign exists before using it.
2012-07-18 14:48:29 -04:00