Antoine Lorence
9b0c9821ed
Fixed #34062 -- Updated View.http_method_not_allowed() to support async.
...
As with the options() methods, wrap the response in a coroutine if
the view is async.
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2022-09-29 16:28:44 +02:00
Tom Carrick
d46cc15c51
Fixed #33878 -- Switched to system fonts in CSS.
2022-08-17 10:19:00 +02:00
Nick Pope
36cd425943
Simplified various built-in templates.
...
- Using the {% plural %} tag.
- Using the |yesno filter.
- Using the |unordered_list filter.
- Unnesting {% if %} where not required.
- Not duplicating {% if %}.
2022-07-25 10:20:46 +02:00
Nick Pope
390832e04a
Standardized formatting in technical 500 template.
...
- Prefer use of `k` and `v` instead of `var.0` and `var.1`.
- Fixed indentation of #files-info block to match adjacent blocks.
2022-07-25 10:19:47 +02:00
Claude Paroz
f2dd652245
Fixed #33863 -- Fixed JavaScriptCatalog with more than 1 level of fallback translations.
...
Co-authored-by: Carlos Mermingas <cmermingas@gmail.com>
2022-07-25 08:45:46 +02:00
Aymeric Augustin
8cf4de206c
Normalized decorator style for functools.wraps.
2022-05-25 10:58:48 +02:00
Aymeric Augustin
aff649a3bd
Normalized imports of functools.wraps.
...
@wraps is 10 times more common than @functools.wraps. Standardize to
the most common version.
2022-05-25 10:58:28 +02:00
Aymeric Augustin
6485894157
Renamed wrapped functions to wrapper.
...
All these functions are wrapping another function. They're the wrapper,
while the function they're wrapping is the wrapped.
2022-05-25 10:53:52 +02:00
Carlton Gibson
9ffd4eae2c
Fixed #33611 -- Allowed View subclasses to define async method handlers.
2022-04-07 07:05:59 +02:00
Carlton Gibson
bb61f0186d
Refs #32365 -- Removed internal uses of utils.timezone.utc alias.
...
Remaining test case ensures that uses of the alias are mapped
canonically by the migration writer.
2022-03-24 06:29:50 +01:00
Mariusz Felisiak
be80aa55ec
Removed outdated handling of length parameter to If-Modified-Since header.
...
The length parameter is not described in RFC-7232 and it's against
HTTP/1.0 and HTTP/1.1 specifications. It was an old and unofficial
extension set by some ancient versions of IE.
2022-03-15 13:07:44 +01:00
Collin Anderson
71017a68a6
Fixed #33571 -- Fixed static serving views crash when If-Modified-Since is empty.
...
Regression in d6aff369ad
.
2022-03-11 06:19:01 +01:00
Claude Paroz
93803a1b5f
Fixed #33567 -- Avoided setting default text/html content type on responses.
2022-03-09 14:50:52 +01:00
Mariusz Felisiak
7119f40c98
Refs #33476 -- Refactored code to strictly match 88 characters line length.
2022-02-07 20:37:05 +01:00
django-bot
9c19aff7c7
Refs #33476 -- Reformatted code with Black.
2022-02-07 20:37:05 +01:00
Keryn Knight
c5c7a15b09
Fixed #33461 -- Escaped template errors in the technical 500 debug page.
2022-01-28 07:07:12 +01:00
Mariusz Felisiak
4ac0bf6acd
Fixed wrapping of long values in technical 500 debug page.
...
Follow up to d5f2d5d604
.
2022-01-24 11:54:41 +01:00
Hrushikesh Vaidya
89d137f3be
Fixed #33457 -- Fixed "Local vars" scrolling in technical 500 debug page.
...
Thanks Keryn Knight for the report and the initial patch.
2022-01-24 07:42:52 +01:00
Claude Paroz
7c4f396509
Stopped including type="text/css" attributes for CSS link tags.
2022-01-22 16:38:14 +01:00
Hrushikesh Vaidya
6815da6e94
Fixed #33396 -- Added view name to technical 500 debug page.
2022-01-13 07:02:41 +01:00
Hrushikesh Vaidya
4099e6e737
Refs #33396 -- Added django.views.debug.get_caller() hook.
2022-01-13 06:50:06 +01:00
Hrushikesh Vaidya
d05ab13c56
Refs #33426 -- Simplified technical_404_response() with ResolverMatch._func_path.
2022-01-12 15:56:59 +01:00
Hrushikesh Vaidya
18a15bbc9c
Fixed #33433 -- Avoided unnecessary resolve() calls in technical_404_response().
...
Thanks Keryn Knight for the initial patch.
2022-01-12 08:23:38 +01:00
Keryn Knight
2a66c102d9
Fixed #33425 -- Fixed view name for CBVs on technical 404 debug page.
...
Regression in 0c0b87725b
.
2022-01-08 13:05:55 +01:00
Keryn Knight
d5f2d5d604
Fixed wrapping of long values in technical 500 debug page.
2021-12-29 07:59:45 +01:00
Mariusz Felisiak
40165eecc4
Fixed #33350 -- Reallowed using cache decorators with duck-typed HttpRequest.
...
Regression in 3fd82a6241
.
Thanks Terence Honles for the report.
2021-12-16 20:13:17 +01:00
Mariusz Felisiak
6bc437c0d8
Refs #33263 -- Added warning to BaseDeleteView when delete() method is overridden.
...
Follow up to 3a45fea083
.
2021-11-09 09:03:40 +01:00
Mariusz Felisiak
5bac1719a2
Refs #32355 -- Used @functools.lru_cache as a straight decorator.
2021-09-27 09:10:58 +02:00
Jan Schär
06e59d97a3
Fixed #33096 -- Fixed <form> nesting in technical 500 template.
...
This also prevents sending <form> tags in emails.
2021-09-10 06:44:39 +02:00
David Smith
1024b5e74a
Fixed 32956 -- Lowercased spelling of "web" and "web framework" where appropriate.
2021-07-29 06:24:12 +02:00
Carlton Gibson
3a45fea083
Fixed #21936 -- Allowed DeleteView to work with custom Forms and SuccessMessageMixin.
...
Thanks to Mariusz Felisiak for review.
Co-authored-by: Demetris Stavrou <demestav@gmail.com>
Co-authored-by: Caroline Simpson <github@hoojiboo.com>
2021-07-14 09:47:03 +02:00
Mateo Radman
8a7ac78b70
Refs #32508 -- Raised ImproperlyConfigured/TypeError instead of using "assert" in various code.
2021-06-25 06:55:47 +02:00
Nick Pope
d06c5b3581
Fixed #32366 -- Updated datetime module usage to recommended approach.
...
- Replaced datetime.utcnow() with datetime.now().
- Replaced datetime.utcfromtimestamp() with datetime.fromtimestamp().
- Replaced datetime.utctimetuple() with datetime.timetuple().
- Replaced calendar.timegm() and datetime.utctimetuple() with datetime.timestamp().
2021-05-12 11:08:41 +02:00
Hasan Ramezani
8bcb00858e
Fixed #32698 -- Moved HttpRequest.get_raw_uri() to ExceptionReporter._get_raw_insecure_uri().
2021-04-30 08:05:42 +02:00
Mariusz Felisiak
d68be0494b
Refs 32637 -- Made technical 404 debug page display exception message when URL is resolved.
...
Follow up to 3b8527e32b
.
2021-04-27 08:40:52 +02:00
Mariusz Felisiak
3b8527e32b
Fixed #32637 -- Restored exception message on technical 404 debug page.
...
Thanks Atul Varma for the report.
2021-04-13 09:15:04 +02:00
Collin Anderson
1c004939d5
Fixed #32624 -- Avoided using JavaScript for "Local vars" show/hide in technical 500 debug page.
2021-04-09 06:33:53 +02:00
William Schwartz
9ee693bd6c
Fixed #32316 -- Deferred accessing __file__.
...
Deferred accessing the module-global variable __file__ because the
Python import API does not guarantee it always exists—in particular, it
does not exist in certain "frozen" environments. The following changes
advanced this goal.
Thanks to Carlton Gibson, Tom Forbes, Mariusz Felisiak, and Shreyas
Ravi for review and feedback.
2021-04-01 14:33:30 +02:00
William Schwartz
7248afe12f
Refs #32105 -- Moved ExceptionReporter template paths to properties.
...
Refs #32316 .
2021-03-31 08:41:57 +02:00
Daniyal
7c08f26bf0
Fixed #32260 -- Made View.as_view() do not use update_wrapper().
...
View.as_view() should not use update_wrapper() for copying attributes
it's unintended and have side-effects such as adding `self` to the
signature.
This also fixes system check for arguments of custom error handler
views with class-based views.
Co-authored-by: Nick Pope <nick.pope@flightdataservices.com>
2021-03-30 07:58:09 +02:00
Adam Johnson
0c0b87725b
Refs #32260 -- Made admindocs and technical 404 debug page use view_func.view_class.
...
Internals of admindocs and technical 404 debug page should use the
view_class attribute and do not rely on __name__.
2021-03-30 06:51:27 +02:00
BeryCZ
807226cd79
Fixed #32480 -- Corrected docstring and removed redundant comments in django/views/defaults.py.
2021-02-24 21:32:37 +01:00
Haki Benita
3fd82a6241
Refs #32468 -- Added error message on invalid usage of cache decorators.
2021-02-24 10:13:51 +01:00
Sandro Covo
6822aa5c6c
Fixed #32345 -- Fixed preserving encoded query strings in set_language() view.
...
Thanks Johannes Maron for the review.
2021-01-29 11:58:43 +01:00
Mariusz Felisiak
d134b0b93e
Refs #15902 -- Stopped set_language() storing user's language in the session.
...
Per deprecation timeline.
2021-01-14 17:50:04 +01:00
Thibaud Colas
fecfec6deb
Improved bidirectionality on the 'Congrats' page.
...
Follow up to 9012033138
.
2020-11-24 13:03:35 +01:00
Thibaud Colas
a1215a3237
Fixed #32053 -- Fixed accessibility issues on the 'Congrats' page.
...
- Add lang attribute.
- Use the same text for the page’s main heading, and title.
- Add underlines for all links in copy.
- Stop using h2 for link to the Django page.
- Use h1 for the main heading.
- Remove useless type attribute on style element.
- Remove grey text that fails contrast checks.
- Use a shade of grey that passes AAA contrast requirements.
- Stop using h4 for footer links.
- Add full stop in block-level links so VoiceOver correctly pauses
between runs of text.
- Hide main artwork for screen reader users.
- Update SVG icons markup to be screen-reader friendly.
- Switch options to be block-level links.
- Remove unused markup.
2020-11-20 19:18:07 +01:00
Author: Nick Pope
20f2b822f8
Added explicit HTMLElement.dir attribute in templates.
2020-11-20 11:09:46 +01:00
Hasan Ramezani
4cd77f97a2
Refs #31672 -- Made technical 500 debug page include exceptions without tracebacks.
2020-11-10 13:21:50 +01:00
Carlton Gibson
ad11f5b8c9
Fixed #32124 -- Added per-view opt-out for APPEND_SLASH behavior.
2020-10-22 14:15:19 +02:00