1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Refs #27358 -- Fixed system check crash with an empty FileField.upload_to.

This commit is contained in:
Lex Berezhny
2016-11-30 09:11:44 -05:00
committed by Tim Graham
parent ddf169cdac
commit 1a9bd75bfa
2 changed files with 7 additions and 1 deletions

View File

@@ -256,7 +256,7 @@ class FileField(Field):
return []
def _check_upload_to(self):
if isinstance(self.upload_to, six.string_types) and self.upload_to[0] == '/':
if isinstance(self.upload_to, six.string_types) and self.upload_to.startswith('/'):
return [
checks.Error(
"%s's 'upload_to' argument must be a relative path, not an "