You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wouldn't len(content) <= 250 and len(summary) >= 250 raise an error if string is equal to 250 characters? The solution error message is "String must be greater/lesser than or equal to 250 characters long"
If I am misunderstanding something, please let me know!
@validates('content', 'summary')
def validate_length(self, key, string):
if( key == 'content'):
if len(string) <= 250:
raise ValueError("Post content must be greater than or equal 250 characters long.")
if( key == 'summary'):
if len(string) >= 250:
raise ValueError("Post summary must be less than or equal to 250 characters long.")
return string
Additional Context
No response
Suggested Changes
No response
The text was updated successfully, but these errors were encountered:
Canvas Link
https://learning.flatironschool.com/courses/6463/assignments/250503?module_item_id=591896
Concern
Wouldn't len(content) <= 250 and len(summary) >= 250 raise an error if string is equal to 250 characters? The solution error message is "String must be greater/lesser than or equal to 250 characters long"
If I am misunderstanding something, please let me know!
@validates('content', 'summary')
def validate_length(self, key, string):
if( key == 'content'):
if len(string) <= 250:
raise ValueError("Post content must be greater than or equal 250 characters long.")
if( key == 'summary'):
if len(string) >= 250:
raise ValueError("Post summary must be less than or equal to 250 characters long.")
return string
Additional Context
No response
Suggested Changes
No response
The text was updated successfully, but these errors were encountered: