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:
Max Goodman
2013-07-18 22:02:00 -07:00
parent 6d82ec79f7
commit 570724107b
2 changed files with 2 additions and 2 deletions

View File

@@ -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":

View File

@@ -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