mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #31812 -- Fixed FileField.model for fields defined in abstract models.
Regression in a93425a37f.
This commit is contained in:
committed by
Mariusz Felisiak
parent
41065cfed5
commit
c1f8d87bb0
@@ -299,6 +299,10 @@ class FileField(Field):
|
||||
file.save(file.name, file.file, save=False)
|
||||
return file
|
||||
|
||||
def contribute_to_class(self, cls, name, **kwargs):
|
||||
super().contribute_to_class(cls, name, **kwargs)
|
||||
setattr(cls, self.attname, self.descriptor_class(self))
|
||||
|
||||
def generate_filename(self, instance, filename):
|
||||
"""
|
||||
Apply (if callable) or prepend (if a string) upload_to to the filename,
|
||||
|
||||
Reference in New Issue
Block a user