From 2e8a663bc46fc69817292b5dfdeab3f11f6983bb Mon Sep 17 00:00:00 2001 From: Brian Simpson Date: Wed, 22 Jul 2015 19:14:42 -0400 Subject: [PATCH] Don't "submit it again" to restricted subreddit. The submit link is based off the comments page of the already submitted link. Check whether the user can submit a link to that subreddit and if they can't don't take them to that subreddit's submit page. --- r2/r2/controllers/front.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/r2/r2/controllers/front.py b/r2/r2/controllers/front.py index cb4a23e10..4799f14f9 100644 --- a/r2/r2/controllers/front.py +++ b/r2/r2/controllers/front.py @@ -288,8 +288,9 @@ class FrontController(RedditController): if request.GET.get('already_submitted'): submit_url = request.GET.get('submit_url') or article.url resubmit_url = Link.resubmit_link(submit_url) - sr_resubmit_url = add_sr(resubmit_url) - infotext = strings.already_submitted % sr_resubmit_url + if c.user_is_loggedin and c.site.can_submit(c.user): + resubmit_url = add_sr(resubmit_url) + infotext = strings.already_submitted % resubmit_url check_cheating('comments')