-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: override default error handlers * don't raise request exception * fix: urls structure * import url patterns * correct number of args * fix sort * pylint ignore
- Loading branch information
Showing
4 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
""" | ||
© Ocado Group | ||
Created on 16/09/2024 at 15:23:05(+01:00). | ||
""" | ||
|
||
from .handlers import handler400, handler403, handler404, handler500 | ||
from .patterns import UrlPatterns, get_urlpatterns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
""" | ||
© Ocado Group | ||
Created on 16/09/2024 at 15:19:54(+01:00). | ||
Custom error handlers which override django's default behavior to render a | ||
template. | ||
https://docs.djangoproject.com/en/3.2/ref/urls/#module-django.conf.urls | ||
""" | ||
|
||
from django.http import ( | ||
HttpResponseBadRequest, | ||
HttpResponseForbidden, | ||
HttpResponseNotFound, | ||
HttpResponseServerError, | ||
) | ||
|
||
# pylint: disable=unnecessary-lambda-assignment | ||
handler400 = lambda request, template: HttpResponseBadRequest() | ||
handler403 = lambda request, template: HttpResponseForbidden() | ||
handler404 = lambda request, template: HttpResponseNotFound() | ||
handler500 = lambda request: HttpResponseServerError() | ||
# pylint: enable=unnecessary-lambda-assignment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters