-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 500 errors caused by templates #395
Conversation
app/logic/__init__.py
Outdated
|
||
def validate_for_template(descriptor): | ||
''' | ||
Cheks if descriptor fields have expected type for template Eg: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small typo: "Checks ..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably it's better to rewrite:
"This function validates field types in the descriptor, e.g., licenses
property should be a list."
def test_validate_for_jinja_modifies_descriptor_if_licenses_is_dict(self): | ||
self.descriptor['licenses'] = {'url': 'test/url', 'type': 'Test'} | ||
descriptor = validate_for_template(self.descriptor) | ||
self.assertEqual(descriptor['license'], 'Test') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so licenses
(plural) then it is a list, and if license
singular then it is a string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great, just small comments
refs #355