diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-01-13 09:49:28 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-01-17 11:49:15 +0100 |
| commit | 94ad46e9d8077d8fadce991af85be657b4a4e2a0 (patch) | |
| tree | c5561c9331ba0497e1042a769633381bd6b9b0f6 /django | |
| parent | 98756c685ee173bbd43f21ed0553f808be835ce5 (diff) | |
Refs #33543 -- Made Expression.asc()/desc() and OrderBy raise ValueError when nulls_first/nulls_last=False is passed.
Per deprecation timeline.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/expressions.py | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/django/db/models/expressions.py b/django/db/models/expressions.py index c270ef16c7..5a1838809c 100644 --- a/django/db/models/expressions.py +++ b/django/db/models/expressions.py @@ -2,7 +2,6 @@ import copy import datetime import functools import inspect -import warnings from collections import defaultdict from decimal import Decimal from uuid import UUID @@ -13,7 +12,6 @@ from django.db.models import fields from django.db.models.constants import LOOKUP_SEP from django.db.models.query_utils import Q from django.utils.deconstruct import deconstructible -from django.utils.deprecation import RemovedInDjango50Warning from django.utils.functional import cached_property from django.utils.hashable import make_hashable @@ -1571,16 +1569,7 @@ class OrderBy(Expression): if nulls_first and nulls_last: raise ValueError("nulls_first and nulls_last are mutually exclusive") if nulls_first is False or nulls_last is False: - # When the deprecation ends, replace with: - # raise ValueError( - # "nulls_first and nulls_last values must be True or None." - # ) - warnings.warn( - "Passing nulls_first=False or nulls_last=False is deprecated, use None " - "instead.", - RemovedInDjango50Warning, - stacklevel=2, - ) + raise ValueError("nulls_first and nulls_last values must be True or None.") self.nulls_first = nulls_first self.nulls_last = nulls_last self.descending = descending |
