Skip to content

Commit

Permalink
fix(validate): pass validation when there is no validator
Browse files Browse the repository at this point in the history
it would be hard for user to fix this until there is a ui,
so rather make it pass the validation and log a warning.

SDESK-333
  • Loading branch information
petrjasek committed Nov 22, 2016
1 parent 46c5282 commit 450e7b2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 2 additions & 1 deletion apps/validate/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,5 @@ def _validate(self, doc, **kwargs):
response.append(message)
return response
else:
return ['validator was not found for {}'.format(doc['act'])]
logger.warn('validator was not found for {}'.format(doc['act']))
return []
7 changes: 2 additions & 5 deletions features/content_publish.feature
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ Feature: Content Publishing
"""

@auth
Scenario: Publish a user content fails if content format is not compatible
Scenario: Publish a user content if content format is not compatible
Given the "validators"
"""
[{"_id": "publish_text", "act": "publish", "type": "text", "schema":{}}]
Expand Down Expand Up @@ -549,10 +549,7 @@ Feature: Content Publishing
}
"""
And we publish "#archive._id#" with "publish" type and "published" state
Then we get response code 400
"""
{"_issues": {"validator exception": "500: Failed to publish the item: PublishQueueError Error 9009 - Item could not be queued"}}
"""
Then we get response code 200

@auth
Scenario: Schedule a user content publish
Expand Down
2 changes: 1 addition & 1 deletion features/validate.feature
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Feature: Validate
"""
Then we get existing resource
"""
{"errors": ["validator was not found for missing"]}
{"errors": []}
"""

@auth
Expand Down

0 comments on commit 450e7b2

Please sign in to comment.