Make submission page's subreddit auto-completion dropdown obey over18 state #747
Make submission page's subreddit auto-completion dropdown obey over18 state #747
Conversation
Do you expect the only over18 option will be used? I think it might be better to drop that and then simplify things. Also rather than creating multiple columns you could store lists of |
💅 |
I considered that option but decided against it because the filtered list may produce fewer than 10 results. If that reason is not convincing enough, just let me know, and I'll change it to the way you described. |
💇 |
I think it's ok to have fewer than 10 results. The unfiltered result is the standard and removing over18 subreddits doesn't get you anything extra. |
Okay, done — the new implementation stores a list of Also, sorry about all the revert commits. If you prefer rebase, I can do that as well. 💇 |
I think the reverted commits and their reverter commit can be rebased out. |
@andre-d: Per your recommendation, I rebased the branch. Though I really wish Github preserved the state before the rebase so no context is lost. @bsimpson63: I simplified POST_search_reddit_names's |
I refactored/simplified the code more to minimize the number of line changes. |
@buddydvd Looks good, I just want to test this a bit before marking it approved. |
🐟 |
Hey sorry to reopen this, but I think 💅 |
Okay, updated 💇 |
💇 Corrected the |
This pull request updates submission page's subreddit auto-completion dropdown to not show over18 subreddits if user's over18 pref is false, which mirrors the behavior of subreddit topic recommender bar at http://www.reddit.com/subreddit (See: https://github.com/reddit/reddit/blob/master/r2/r2/controllers/api.py#L3179).
Steps to reproduce:
Expected result:
The auto-completion dropdown box shows a list of non-over18 subreddits that have "pics" as their prefix.
Actual result:
The auto-completion dropdown shows the following subreddits:
The proposed update makes it so that those subreddits only show up if they have set their account's over18 pref to true.
Lastly, it does so without breaking existing API clients by preserving the previous behavior as the default option for
POST_search_reddit_names
.