diff options
| author | Tom Christie | 2013-05-18 07:17:13 -0700 |
|---|---|---|
| committer | Tom Christie | 2013-05-18 07:17:13 -0700 |
| commit | e32a6e4211fc8daf7deb443aa68a71bdc273b8e3 (patch) | |
| tree | b65bad379651f4c934647c1e93947214efd1f369 /rest_framework/relations.py | |
| parent | a2e2b0abdad05975036c8478d86bd30b13bc83c2 (diff) | |
| parent | aeba5bed05e37344caf15adff180fc48404d992d (diff) | |
| download | django-rest-framework-e32a6e4211fc8daf7deb443aa68a71bdc273b8e3.tar.bz2 | |
Merge pull request #860 from andymckay/master
startswith can take a tuple
Diffstat (limited to 'rest_framework/relations.py')
| -rw-r--r-- | rest_framework/relations.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rest_framework/relations.py b/rest_framework/relations.py index 3aaf6648..c4271e33 100644 --- a/rest_framework/relations.py +++ b/rest_framework/relations.py @@ -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__) |
