mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Toolbar: Remove then parameter for submit
The reddit toolbar is no longer supported. Remove the option to redirect to the toolbar after submitting a link.
This commit is contained in:
@@ -416,14 +416,13 @@ class ApiController(RedditController):
|
||||
sendreplies=VBoolean('sendreplies'),
|
||||
selftext=VMarkdown('text'),
|
||||
kind=VOneOf('kind', ['link', 'self']),
|
||||
then=VOneOf('then', ('tb', 'comments'), default='comments'),
|
||||
extension=VLength("extension", 20,
|
||||
docs={"extension": "extension used for redirects"}),
|
||||
resubmit=VBoolean('resubmit'),
|
||||
)
|
||||
@api_doc(api_section.links_and_comments)
|
||||
def POST_submit(self, form, jquery, url, selftext, kind, title,
|
||||
sr, then, extension, sendreplies, resubmit):
|
||||
sr, extension, sendreplies, resubmit):
|
||||
"""Submit a link to a subreddit.
|
||||
|
||||
Submit will create a link or self-post in the subreddit `sr` with the
|
||||
@@ -575,12 +574,7 @@ class ApiController(RedditController):
|
||||
l.update_search_index()
|
||||
g.events.submit_event(l, request=request, context=c)
|
||||
|
||||
if then == 'comments':
|
||||
path = add_sr(l.make_permalink_slow())
|
||||
elif then == 'tb':
|
||||
form.attr('target', '_top')
|
||||
path = add_sr('/tb/%s' % l._id36)
|
||||
|
||||
path = add_sr(l.make_permalink_slow())
|
||||
if extension:
|
||||
path += ".%s" % extension
|
||||
|
||||
|
||||
@@ -1196,9 +1196,8 @@ class FrontController(RedditController):
|
||||
@validate(url=VRequired('url', None),
|
||||
title=VRequired('title', None),
|
||||
text=VRequired('text', None),
|
||||
selftext=VRequired('selftext', None),
|
||||
then=VOneOf('then', ('tb','comments'), default='comments'))
|
||||
def GET_submit(self, url, title, text, selftext, then):
|
||||
selftext=VRequired('selftext', None))
|
||||
def GET_submit(self, url, title, text, selftext):
|
||||
"""Submit form."""
|
||||
resubmit = request.GET.get('resubmit')
|
||||
url = sanitize_url(url)
|
||||
@@ -1249,7 +1248,6 @@ class FrontController(RedditController):
|
||||
show_link=c.default_sr or c.site.can_submit_link(c.user),
|
||||
show_self=((c.default_sr or c.site.can_submit_text(c.user))
|
||||
and not request.GET.get('no_self')),
|
||||
then=then,
|
||||
)
|
||||
|
||||
return FormPage(_("submit"),
|
||||
|
||||
@@ -3245,7 +3245,7 @@ class FrameToolbar(Wrapped):
|
||||
class NewLink(Templated):
|
||||
"""Render the link submission form"""
|
||||
def __init__(self, captcha=None, url='', title='', text='', selftext='',
|
||||
then='comments', resubmit=False, default_sr=None,
|
||||
resubmit=False, default_sr=None,
|
||||
extra_subreddits=None, show_link=True, show_self=True):
|
||||
|
||||
self.show_link = show_link
|
||||
@@ -3284,7 +3284,7 @@ class NewLink(Templated):
|
||||
self.extra_subreddits = extra_subreddits
|
||||
|
||||
Templated.__init__(self, captcha = captcha, url = url,
|
||||
title = title, text = text, then = then)
|
||||
title = title, text = text)
|
||||
|
||||
class ShareLink(CachedTemplate):
|
||||
def __init__(self, link_name = "", emails = None):
|
||||
|
||||
Reference in New Issue
Block a user