From 25fd113b2a3d210f969ea4cc3f630ce5b1f769f6 Mon Sep 17 00:00:00 2001 From: q0w <43147888+q0w@users.noreply.github.com> Date: Sun, 25 Feb 2024 11:45:33 +0300 Subject: [PATCH] Pass positional arguments name and violation_error_message to BaseConstraint --- django-stubs/db/models/constraints.pyi | 2 +- scripts/stubtest/allowlist_todo_django50.txt | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/django-stubs/db/models/constraints.pyi b/django-stubs/db/models/constraints.pyi index 50a4a474f..02a6f7891 100644 --- a/django-stubs/db/models/constraints.pyi +++ b/django-stubs/db/models/constraints.pyi @@ -18,7 +18,7 @@ class BaseConstraint: violation_error_code: str | None violation_error_message: _StrOrPromise | None default_violation_error_message: _StrOrPromise - def __init__(self, name: str, violation_error_message: _StrOrPromise | None = ...) -> None: ... + def __init__(self, *, name: str, violation_error_message: _StrOrPromise | None = ...) -> None: ... def constraint_sql(self, model: type[Model] | None, schema_editor: BaseDatabaseSchemaEditor | None) -> str: ... def create_sql(self, model: type[Model] | None, schema_editor: BaseDatabaseSchemaEditor | None) -> str: ... def remove_sql(self, model: type[Model] | None, schema_editor: BaseDatabaseSchemaEditor | None) -> str: ... diff --git a/scripts/stubtest/allowlist_todo_django50.txt b/scripts/stubtest/allowlist_todo_django50.txt index 5981ff9f2..5dae86705 100644 --- a/scripts/stubtest/allowlist_todo_django50.txt +++ b/scripts/stubtest/allowlist_todo_django50.txt @@ -46,7 +46,6 @@ django.contrib.gis.admin.OpenLayersWidget django.contrib.gis.admin.options.spherical_mercator_srid django.contrib.gis.admin.widgets django.contrib.gis.db.backends.spatialite.schema.SpatialiteSchemaEditor.alter_db_table -django.contrib.gis.db.models.BaseConstraint.__init__ django.contrib.gis.db.models.Case.allowed_default django.contrib.gis.db.models.ExpressionWrapper.allowed_default django.contrib.gis.db.models.F.allowed_default @@ -150,7 +149,6 @@ django.db.backends.sqlite3.schema.DatabaseSchemaEditor.sql_alter_column_comment django.db.backends.sqlite3.schema.DatabaseSchemaEditor.sql_alter_table_comment django.db.backends.utils.CursorWrapper.APPS_NOT_READY_WARNING_MSG django.db.migrations.serializer.BaseUnorderedSequenceSerializer -django.db.models.BaseConstraint.__init__ django.db.models.Case.allowed_default django.db.models.ExpressionWrapper.allowed_default django.db.models.F.allowed_default @@ -169,7 +167,6 @@ django.db.models.Prefetch.get_current_querysets django.db.models.Q.identity django.db.models.Value.allowed_default django.db.models.When.allowed_default -django.db.models.constraints.BaseConstraint.__init__ django.db.models.expressions.BaseExpression.allowed_default django.db.models.expressions.Case.allowed_default django.db.models.expressions.CombinedExpression.allowed_default