Skip to content

Commit

Permalink
Fixed #35815 -- Allowed db_default to be a literal.
Browse files Browse the repository at this point in the history
  • Loading branch information
timgraham committed Oct 14, 2024
1 parent cd62f55 commit 74a6b65
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion django/db/models/fields/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,10 @@ def _check_db_default(self, databases=None, **kwargs):

if (
self.db_default is NOT_PROVIDED
or isinstance(self.db_default, Value)
or (
isinstance(self.db_default, Value)
or not hasattr(self.db_default, "resolve_expression")
)
or databases is None
):
return []
Expand Down

0 comments on commit 74a6b65

Please sign in to comment.