mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-14 09:27:57 -05:00
POST_compose: use validator's 'required' parameter
We're just ignoring the error that gets set, so we might as well have it not set that error in the first place if we don't care about it.
This commit is contained in:
@@ -328,7 +328,7 @@ class ApiController(RedditController):
|
||||
VCaptcha(),
|
||||
VUser(),
|
||||
VModhash(),
|
||||
from_sr=VSRByName('from_sr'),
|
||||
from_sr=VSRByName('from_sr', required=False),
|
||||
to=VMessageRecipient('to'),
|
||||
subject=VLength('subject', 100, empty_error=errors.NO_SUBJECT),
|
||||
body=VMarkdownLength(['text', 'message'], max_length=10000),
|
||||
@@ -369,8 +369,6 @@ class ApiController(RedditController):
|
||||
if from_sr and from_sr._spam:
|
||||
return
|
||||
|
||||
c.errors.remove((errors.BAD_SR_NAME, "from_sr"))
|
||||
|
||||
if from_sr:
|
||||
if not from_sr.is_moderator_with_perms(c.user, "mail"):
|
||||
abort(403)
|
||||
|
||||
Reference in New Issue
Block a user