Skip to content

Commit 23c6af4

Browse files
committed
Fixed #35815 -- Allowed db_default to be a literal.
1 parent 4b4fd1a commit 23c6af4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

django/db/models/fields/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,10 @@ def _check_db_default(self, databases=None, **kwargs):
392392

393393
if (
394394
self.db_default is NOT_PROVIDED
395-
or isinstance(self.db_default, Value)
395+
or (
396+
isinstance(self.db_default, Value)
397+
or not hasattr(self.db_default, "resolve_expression")
398+
)
396399
or databases is None
397400
):
398401
return []

0 commit comments

Comments
 (0)