mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-29 00:38:11 -05:00
Treat empty inputs as non-errors in two wiki validators.
If VLength (or its subclass) gets an empty input, by default it will set an error state. This error state now has a code param, which causes wiki code to treat it as fatal. This change disables the empty error in two places, when appropriate.
This commit is contained in:
@@ -582,7 +582,7 @@ def paginated_listing(default_page_size=25, max_page_size=100, backend='sql'):
|
||||
before=VByName('before', backend=backend),
|
||||
count=VCount('count'),
|
||||
target=VTarget("target"),
|
||||
show=VLength('show', 3))
|
||||
show=VLength('show', 3, empty_error=None))
|
||||
@wraps(fn)
|
||||
def new_fn(self, before, **env):
|
||||
if c.render_style == "htmllite":
|
||||
|
||||
@@ -299,7 +299,7 @@ class WikiApiController(WikiController):
|
||||
pageandprevious=VWikiPageRevise(('page', 'previous'), restricted=True),
|
||||
content=nop(('content')),
|
||||
page_name=VWikiPageName('page'),
|
||||
reason=VPrintable('reason', 256))
|
||||
reason=VPrintable('reason', 256, empty_error=None))
|
||||
@api_doc(api_section.wiki, uri='/api/wiki/edit')
|
||||
def POST_wiki_edit(self, pageandprevious, content, page_name, reason):
|
||||
page, previous = pageandprevious
|
||||
|
||||
Reference in New Issue
Block a user