mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-24 22:38:09 -05:00
Add useful error page when forbidden from private subreddit.
This commit is contained in:
@@ -878,6 +878,9 @@ class RedditController(MinimalController):
|
||||
|
||||
# check if the user has access to this subreddit
|
||||
if not c.site.can_view(c.user) and not c.error_page:
|
||||
errpage = pages.RedditError(strings.private_subreddit_title,
|
||||
strings.private_subreddit_message)
|
||||
request.environ['usable_error_content'] = errpage.render()
|
||||
self.abort403()
|
||||
|
||||
#check over 18
|
||||
|
||||
@@ -130,6 +130,8 @@ string_dict = dict(
|
||||
link_info_title = _("%(title)s : %(site)s"),
|
||||
banned_subreddit_title = _("this subreddit has been banned"),
|
||||
banned_subreddit_message = _("most likely this was done automatically by our spam filtering program. the program is still learning, and may even have some bugs, so if you feel the ban was a mistake, please submit a link to our [request a subreddit listing](%(link)s) and be sure to include the **exact name of the subreddit**."),
|
||||
private_subreddit_title = _("this subreddit is private"),
|
||||
private_subreddit_message = _("the moderators of this subreddit have set it to private. you must be a moderator or approved submitter to view its contents."),
|
||||
comments_panel_text = _("""The following is a sample of what Reddit users had to say about this page. The full discussion is available [here](%(fd_link)s); you can also get there by clicking the link's title (in the middle of the toolbar, to the right of the comments button)."""),
|
||||
|
||||
submit_link = _("""You are submitting a link. The key to a successful submission is interesting content and a descriptive title."""),
|
||||
|
||||
Reference in New Issue
Block a user