mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #21042 -- Allowed accessing FileDescriptor on the model class.
This is consistent with ability to reference other descriptors
on the model class (5ef0c03ae9).
This commit is contained in:
@@ -157,9 +157,7 @@ class FileDescriptor(object):
|
||||
|
||||
def __get__(self, instance=None, owner=None):
|
||||
if instance is None:
|
||||
raise AttributeError(
|
||||
"The '%s' attribute can only be accessed from %s instances."
|
||||
% (self.field.name, owner.__name__))
|
||||
return self
|
||||
|
||||
# This is slightly complicated, so worth an explanation.
|
||||
# instance.file`needs to ultimately return some instance of `File`,
|
||||
|
||||
Reference in New Issue
Block a user