Merge pull request #860 from andymckay/master

startswith can take a tuple
This commit is contained in:
Tom Christie 2013-05-18 07:17:13 -07:00
commit e32a6e4211

View File

@ -448,7 +448,7 @@ class HyperlinkedRelatedField(RelatedField):
raise Exception('Writable related fields must include a `queryset` argument')
try:
http_prefix = value.startswith('http:') or value.startswith('https:')
http_prefix = value.startswith(('http:', 'https:'))
except AttributeError:
msg = self.error_messages['incorrect_type']
raise ValidationError(msg % type(value).__name__)