summaryrefslogtreecommitdiff
path: root/django/template
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #34518 -- Fixed crash of random() template filter with an empty list.David Sanders2023-04-261-1/+4
|
* Refs #34482 -- Reverted "Fixed #32969 -- Fixed pickling HttpResponse and ↵Mariusz Felisiak2023-04-121-7/+8
| | | | | | | | subclasses." This reverts commit d7f5bfd241666c0a76e90208da1e9ef81aec44db. Thanks Márton Salomváry for the report.
* Fixed #34427 -- Improved error message when context processor does not ↵David Sanders2023-03-291-1/+9
| | | | return a dict.
* Fixed #34363 -- Fixed floatformat crash on zero with trailing zeros.Panagiotis H.M. Issaris2023-02-221-1/+2
| | | | Regression in 08c5a787262c1ae57f6517d4574b54a5fcaad124. Follow up to 4b066bde692078b194709d517b27e55defae787c.
* Refs #7430 -- Removed broken Template.__iter__().Anders Hovmöller2023-02-081-4/+0
| | | Co-authored-by: Anders Hovmöller <anders.hovmoller@dryft.se>
* Refs #33476 -- Applied Black's 2023 stable style.David Smith2023-02-015-5/+0
| | | | | | | | Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
* Fixed #34272 -- Fixed floatformat crash on zero with trailing zeros to zero ↵David Wobrock2023-01-191-1/+1
| | | | | | | | decimal places. Regression in 08c5a787262c1ae57f6517d4574b54a5fcaad124. Thanks Andrii Lahuta for the report.
* Refs #34233 -- Used str.removeprefix()/removesuffix().Mariusz Felisiak2023-01-181-1/+1
|
* Fixed #34220 -- Moved csrf_input_lazy, csrf_token_lazy imports to the toplevel.rajdesai242023-01-061-2/+1
| | | This prevents random errors with partially initialized modules.
* Fixed #34098 -- Fixed loss of precision for Decimal values in floatformat ↵Vlastimil Zíma2022-10-241-1/+1
| | | | | filter. Regression in 12f7928f5a455e330c0a7f19bc86b37baca12811.
* Fixed #33864 -- Deprecated length_is template filter.Nick Pope2022-07-231-0/+7
|
* Fixed #32969 -- Fixed pickling HttpResponse and subclasses.Anv3sh2022-06-201-8/+7
|
* Normalized imports of functools.wraps.Aymeric Augustin2022-05-251-3/+3
| | | | | @wraps is 10 times more common than @functools.wraps. Standardize to the most common version.
* Fixed #33653 -- Fixed template crash when calling methods for built-in types ↵cheng2022-05-201-7/+10
| | | | | | without required arguments. Regression in 09341856ed9008875c1cc883dc0c287670131458.
* Fixed #33639 -- Enabled cached template loader in development.Carlton Gibson2022-04-191-2/+1
|
* Fixed #33628 -- Ignored directories with empty names in autoreloader check ↵Manel Clos2022-04-111-2/+2
| | | | | | for template changes. Regression in 68357b2ca9e88c40fc00d848799813241be39129.
* Removed unused Node.__iter__().Keryn Knight2022-02-161-3/+0
|
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-072-8/+15
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-0725-615/+847
|
* Fixed #33473 -- Fixed detecting changes by autoreloader in .py files inside ↵Hrushikesh Vaidya2022-02-031-0/+2
| | | | template directories.
* Refs #33476 -- Refactored problematic code before reformatting by Black.Mariusz Felisiak2022-02-035-23/+32
| | | | | | | | | | | | | | | | | In these cases Black produces unexpected results, e.g. def make_random_password( self, length=10, allowed_chars='abcdefghjkmnpqrstuvwxyz' 'ABCDEFGHJKLMNPQRSTUVWXYZ' '23456789', ): or cursor.execute(""" SELECT ... """, [table name], )
* Fixed #33474 -- Added __slots__ to Variable and FilterExpression.Keryn Knight2022-02-021-0/+5
|
* Fixed CVE-2022-22818 -- Fixed possible XSS via {% debug %} template tag.Markus Holtermann2022-02-011-3/+6
| | | | | | Thanks Keryn Knight for the report. Co-authored-by: Adam Johnson <me@adamj.eu>
* Simplified @stringfilter decorator and Library with unwrap().Baptiste Mispelon2022-01-102-20/+14
| | | | | | Nowadays we can use inspect.unwrap() to retrieve the innermost function object when needed, and most of the uses of _decorated_function were to access the original __name__ which is not needed because @functools.wraps sets that attribute correctly.
* Avoided isinstance(…, Variable) calls in FilterExpression.resolve().Keryn Knight2022-01-071-1/+2
| | | | | | By determining the variable type within __init__() instead of resolve() we can skip an isinstance() check at template runtime. Templates are executed in production more often than the parse trees themselves, assuming the cached Loader is used.
* Fixed CVE-2021-45116 -- Fixed potential information disclosure in dictsort ↵Florian Apolloner2022-01-041-5/+17
| | | | | | | | template filter. Thanks to Dennis Brinkrolf for the report. Co-authored-by: Adam Johnson <me@adamj.eu>
* Optimized django.template.autoreload.get_template_directories() a bit.Adam Johnson2021-12-211-2/+3
|
* Refs #32290 -- Optimized construct_relative_path() by delay computing ↵Keryn Knight2021-12-081-4/+4
| | | | has_quotes.
* Fixed #33302 -- Made element_id optional argument for json_script template ↵Baptiste Mispelon2021-11-221-2/+2
| | | | | | filter. Added versionchanged note in documentation
* Refs #32987 -- Refactored out get_template_tag_modules().Daniel Fairhead2021-10-201-10/+19
|
* Used Path.read_text() in jinja2.get_exception_info().Mariusz Felisiak2021-09-271-2/+1
|
* Refs #32355 -- Used @functools.lru_cache as a straight decorator.Mariusz Felisiak2021-09-272-2/+2
|
* Fixed #30086, Refs #32873 -- Made floatformat template filter independent of ↵Mariusz Felisiak2021-09-081-9/+31
| | | | USE_L10N.
* Refs #32919 -- Simplified Lexer.create_token() by reorganizing blocks.Chris Jerdonek2021-08-251-21/+27
|
* Refs #32919 -- Added assertion for token start in Lexer.create_token().Chris Jerdonek2021-08-251-3/+3
| | | | | This adds an assertion in the code path where the method would otherwise return None, which isn't allowed.
* Fixed #33036 -- Made simple_tag()/inclusion_tag() with takes_context raise ↵Matt Westcott2021-08-191-1/+1
| | | | TemplateSyntaxError when function has no parameters.
* Fixed #33002 -- Made DebugLexer.tokenize() more closely parallel ↵Chris Jerdonek2021-08-091-13/+21
| | | | Lexer.tokenize().
* Refs #33002 -- Renamed variable from bit to token_string in Lexer.tokenize().Chris Jerdonek2021-08-091-4/+4
|
* Refs #33002 -- Optimized Lexer.tokenize() by skipping computing lineno when ↵Chris Jerdonek2021-08-091-1/+1
| | | | not needed.
* Fixed #32990 -- Simplified and optimized tag regex.Greg Twohig2021-08-091-6/+4
| | | | Thanks Chris Jerdonek for the review.
* Refs #32986 -- Moved TRANSLATOR_COMMENT_MARK to ↵Chris Jerdonek2021-08-051-1/+0
| | | | django.utils.translation.template.
* Fixed #32986 -- Removed unneeded str.find() call in Lexer.create_token().Chris Jerdonek2021-08-051-3/+1
| | | | Unnecessary since 47ddd6a4082d55d8856b7e6beac553485dd627f7.
* Fixed #32919 -- Optimized lexing & parsing of templates.Keryn Knight2021-08-023-11/+26
| | | | | | | | | | This optimizes: - Lexer.create_token() by avoiding startswith() calls, - Parser.parse() by re-using the token type enum's value, - Parser.extend_nodelist() by removing unnecessary isinstance() check, - some Node subclasses by removing the implicit "nodelist" from "child_nodelists", - Variable.__init__() by avoiding startswith() calls.
* Fixed #28935 -- Fixed display of errors in extended blocks.cammil2021-07-021-2/+11
| | | | | | Get the template that caused the exception and get the exception info from that template, using the node that caused the exception.
* Fixed #32824 -- Improved performance of NodeList.render().Keryn Knight2021-06-111-9/+4
| | | | | | | | | | | This avoids the following: - checking that each item in the nodelist is a subclass of Node, - calling str() on the render_annotated() output, because it's documented that Node.render() must return a string, - calling mark_safe() on the output, when the value to be wrapped is definitively known to be a string because the result of ''.join() is always of that type, - using an intermediate list to store each individual string.
* Refs #24121 -- Added __repr__() to AdminForm, BlockContext, ↵saeedblanchette2021-06-101-0/+6
| | | | BlockTranslateNode, and IncludeNode.
* Fixed #32814 -- Improved performance of TextNode.Keryn Knight2021-06-071-0/+9
| | | | This avoids calling render() and handling exceptions, which is not necessary for text nodes.
* Refs #24121 -- Added __repr__() to Engineabhiabhi942021-06-011-0/+20
|
* Fixed #32744 -- Normalized to pathlib.Path in autoreloader check for ↵Hasan Ramezani2021-05-261-2/+5
| | | | template changes.
* Refs #24121 -- Added __repr__() to Origin and Template.Tiago Honorato2021-03-171-0/+9
|