Some account information for users in permanent suspension, such as karma, are
still accessible through the api. This info is hidden on the site, so it should
be treated similarly in the API response.
This needs to be called on posts being removed by the "all" filter
setting to update some info on them and put them into the correct cached
queries so that they show up in pages where the mods expect them.
You can run `vagrant up` from any directory within a project--vagrant
will look for a Vagrantfile in the current directory and if it doesn't
find one walk up one directory, and repeat until it finds a Vagrantfile.
Previously the `code_share_host_path` was set assuming that `vagrant up`
would always be run from the root reddit directory. Now it is set from the
fixed known location of the Vagrantfile.
This was previously being done in the spam-filter itself, so if there
are site issues causing the filter to fall behind, subreddits that use
the "all" setting to initially remove all posts would have it stop
working until the filter was able to catch up.
This moves the check into the actual posting process so that it isn't
dependent on the filter at all (and will also make this setting function
on open-source installs where the spam-filter code isn't available).
For events with a notion of a `target`, this stores:
* `target._age` as `target_age_seconds` in seconds. This is derivable from the event timestamp and the `target_created_ts` but simpler to query if it's denormalized
* For `Link`s, store the `target.title` as `target_title`. The primary goal here is to add more context around reports in Interana.
Also add a test for the report event and fixup the existing tests.
Don't allow sharing, saving, or hiding a deleted post. A user can unsave and
unhide a deleted post so that it's not stuck in the user's saved/hidden lists.
The share feature is currently broken on promoted links that have comments
disabled. Since the share feature relies on links having a comments thread,
hide it for any link with comments disabled.
Neither of these are used at all, so this code can be simplified a bit
by dropping them. get_cols was being specifically set to False in the
code so everything related to it being True was completely dead code.
As of 156672bed6 we started checking the
title of submissions at submit-time to see if they should be set to
NSFW. Between that and backfilling all existing submissions to have the
NSFW flag set correctly based on their titles, we can now remove the
display-time check.
This will allow moderators and submitters to turn off NSFW even if
"NSFW" or "NSFL" is in the title. This was an annoyance in cases where
the submitter puts something like "(not NSFW)" in the title but then had
the flag stuck on because of the display-time check.
So we know whether or not to show a "wiki" button, include wiki_enabled.
This will be "true" if the wiki is public, or if you are a mod/admin and
the wiki is set to "mod only"; othrewise, it will return "false".
We only show the create subreddit button in the sidebar to users whose
account is at least 30 days old, but since there are now some additional
requirements for creating a subreddit, this means that sometimes we end
up showing the button to people that won't be able to successfully
create a subreddit. This keeps the 30-day restriction, but on top of
that also checks that the user's actually going to be able to create
before showing the button.
Otherwise we may pollute the cache with un-loaded Account objects.
This is almost guaranteed to happen when Account.friend_rels needs
to load the Accounts with data immediately after calling
Account.friend_rels_cache.