Skip to content

Commit a226989

Browse files
authored
Merge pull request #25 from eadwinCode/request_logging_to_debug
Request Logger Fix
2 parents c761a91 + 00ab897 commit a226989

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

.github/workflows/test_full.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
steps:
3333
- uses: actions/checkout@v2
3434
- name: Set up Python
35-
uses: actions/setup-python@v1
35+
uses: actions/setup-python@v2
3636
with:
3737
python-version: 3.9
3838
- name: Install Flit

ninja_extra/compatible.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
import sys
22

3+
from ninja.constants import NOT_SET
4+
5+
__all__ = ["asynccontextmanager", "NOT_SET_TYPE"]
6+
37
if sys.version_info >= (3, 7):
48
from contextlib import asynccontextmanager as asynccontextmanager # noqa
59
else:
610
from contextlib2 import asynccontextmanager as asynccontextmanager # noqa
11+
12+
try:
13+
from ninja.constants import NOT_SET_TYPE # noqa
14+
except Exception:
15+
NOT_SET_TYPE = type(NOT_SET) # noqa

ninja_extra/logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import logging
22

3-
request_logger = logging.getLogger("django.request")
3+
request_logger = logging.getLogger("django")

ninja_extra/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from ninja.renderers import BaseRenderer
1212

1313
from ninja_extra import exceptions, router
14+
from ninja_extra.compatible import NOT_SET_TYPE
1415
from ninja_extra.controllers.base import APIController, ControllerBase
1516
from ninja_extra.controllers.registry import ControllerRegistry
1617

@@ -30,7 +31,7 @@ def __init__(
3031
docs_url: Optional[str] = "/docs",
3132
urls_namespace: Optional[str] = None,
3233
csrf: bool = False,
33-
auth: Union[Sequence[Callable], Callable, object] = NOT_SET,
34+
auth: Union[Sequence[Callable], Callable, NOT_SET_TYPE] = NOT_SET,
3435
renderer: Optional[BaseRenderer] = None,
3536
parser: Optional[Parser] = None,
3637
app_name: str = "ninja",

0 commit comments

Comments
 (0)