Skip to content

Commit d4e1f38

Browse files
authored
Merge pull request #171 from eadwinCode/missing_throttling_param
fix: throttle not used in NinjaExtraAPI __init__
2 parents b9ba312 + 5fd4160 commit d4e1f38

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

ninja_extra/controllers/model/builder.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ def __init__(
2828
model_pk = getattr(
2929
self._config.model._meta.pk,
3030
"name",
31-
self._config.model._meta.pk.attname, # type:ignore[union-attr]
32-
)
33-
internal_type = (
34-
self._config.model._meta.pk.get_internal_type() # type:ignore[union-attr]
31+
self._config.model._meta.pk.attname,
3532
)
33+
internal_type = self._config.model._meta.pk.get_internal_type()
3634
self._pk_type: t.Type = TYPES.get(internal_type, str)
3735
self._model_pk_name = model_pk
3836
self._model_name = self._config.model.__name__.replace("Model", "")

ninja_extra/controllers/model/schemas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def generate_all_schema(self) -> None:
109109
model_pk = getattr(
110110
self.model._meta.pk,
111111
"name",
112-
self.model._meta.pk.attname, # type:ignore[union-attr]
112+
self.model._meta.pk.attname,
113113
)
114114

115115
if (

ninja_extra/controllers/route/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def _create_route_function(
150150
if not isinstance(type_hint, t._SpecialForm):
151151
response = type_hint
152152
route_obj = cls(
153-
view_func,
153+
view_func, # type:ignore[arg-type]
154154
path=path,
155155
methods=methods,
156156
auth=auth,

ninja_extra/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def __init__(
7171
servers=servers,
7272
docs=docs,
7373
docs_decorator=docs_decorator,
74+
throttle=throttle,
7475
**kwargs,
7576
)
7677
self.app_name = app_name

0 commit comments

Comments
 (0)