Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -9,17 +9,17 @@ repos:
- id: check-symlinks
- id: check-toml
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: 3.9.0
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-tidy-imports
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.13.0
rev: 1.16.0
hooks:
- id: blacken-docs
exclude: ^(?!docs).*$
Expand Down
8 changes: 2 additions & 6 deletions docs/community/3.5-announcement.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,10 @@ from rest_framework.schemas import get_schema_view
from rest_framework_swagger.renderers import OpenAPIRenderer, SwaggerUIRenderer

schema_view = get_schema_view(
title='Example API',
renderer_classes=[OpenAPIRenderer, SwaggerUIRenderer]
title="Example API", renderer_classes=[OpenAPIRenderer, SwaggerUIRenderer]
)

urlpatterns = [
path('swagger/', schema_view),
...
]
urlpatterns = [path("swagger/", schema_view), ...]
```

There have been a large number of fixes to the schema generation. These should
Expand Down
4 changes: 2 additions & 2 deletions docs/topics/browsable-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ To quickly add authentication to the browesable api, add a routes named `"login"

```python
urlpatterns = [
// ...
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
# ...
url(r"^api-auth/", include("rest_framework.urls", namespace="rest_framework"))
]
```

Expand Down
2 changes: 1 addition & 1 deletion rest_framework/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def decorator(func):
# WrappedAPIView.__doc__ = func.doc <--- Not possible to do this

# api_view applied without (method_names)
assert not(isinstance(http_method_names, types.FunctionType)), \
assert not isinstance(http_method_names, types.FunctionType), \
'@api_view missing list of allowed HTTP methods'

# api_view applied with eg. string instead of list of strings
Expand Down
2 changes: 1 addition & 1 deletion tests/test_throttling.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def ensure_response_header_contains_proper_throttle_field(self, view, expected_h
if expect is not None:
assert response['Retry-After'] == expect
else:
assert not'Retry-After' in response
assert 'Retry-After' not in response

def test_seconds_fields(self):
"""
Expand Down