1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #29529 -- Allowed models.fields.FilePathField to accept a callable path.

This commit is contained in:
Mykola Kokalko
2019-05-02 10:42:10 +02:00
committed by Mariusz Felisiak
parent 11971cd87c
commit ef082ebb84
4 changed files with 30 additions and 1 deletions

View File

@@ -1709,7 +1709,7 @@ class FilePathField(Field):
def formfield(self, **kwargs):
return super().formfield(**{
'path': self.path,
'path': self.path() if callable(self.path) else self.path,
'match': self.match,
'recursive': self.recursive,
'form_class': forms.FilePathField,