Skip to content

Commit 74a6b65

Browse files
committed
Fixed #35815 -- Allowed db_default to be a literal.
1 parent cd62f55 commit 74a6b65

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
@@ -391,7 +391,10 @@ def _check_db_default(self, databases=None, **kwargs):
391391

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

0 commit comments

Comments
 (0)