[Django] #32139: Add check, that raise TemplateException, when argument 'only' provided more then once in tag 'include'

30 views
Skip to first unread message

Django

unread,
Oct 24, 2020, 3:27:03 PM10/24/20
to django-...@googlegroups.com
#32139: Add check, that raise TemplateException, when argument 'only' provided more
then once in tag 'include'
-------------------------------------------+------------------------
Reporter: Mikhail Fesenko | Owner: nobody
Type: Uncategorized | Status: new
Component: Template system | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------
https://github.com/django/django/pull/13492

I've added code with this fix, and test for it

--
Ticket URL: <https://code.djangoproject.com/ticket/32139>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 24, 2020, 3:40:50 PM10/24/20
to django-...@googlegroups.com
#32139: Add check, that raise TemplateException, when argument 'only' provided more
then once in tag 'include'
-------------------------------------+-------------------------------------

Reporter: Mikhail Fesenko | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* type: Uncategorized => Cleanup/optimization


Old description:

> https://github.com/django/django/pull/13492
>
> I've added code with this fix, and test for it

New description:

https://github.com/django/django/pull/13597

I've added code with this fix, and test for it

--

--
Ticket URL: <https://code.djangoproject.com/ticket/32139#comment:2>

Django

unread,
Oct 24, 2020, 3:57:54 PM10/24/20
to django-...@googlegroups.com
#32139: Add check, that raise TemplateException, when argument 'only' provided more
then once in tag 'include'
-------------------------------------+-------------------------------------

Reporter: Mikhail Fesenko | Owner: nobody
Type: | Status: closed
Cleanup/optimization |

Component: Template system | Version: master
Severity: Normal | Resolution:
| worksforme
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* status: new => closed
* resolution: => worksforme


Comment:

Hi Mikhail, thanks for this contribution, but the test you submitted
passes without your patch. Further, I don't see how your patch would
execute since `if option in options` raises an exception a few lines
above. Finally, and for the same reason, I don't think the test you
provided meaningfully increases coverage since there are test methods
`test_variable_twice()` and `test_syntax_error_duplicate_option()` that
already test this.

--
Ticket URL: <https://code.djangoproject.com/ticket/32139#comment:3>

Django

unread,
Oct 25, 2020, 5:40:39 AM10/25/20
to django-...@googlegroups.com
#32139: Add check, that raise TemplateException, when argument 'only' provided more
then once in tag 'include'
-------------------------------------+-------------------------------------

Reporter: Mikhail Fesenko | Owner: nobody
Type: | Status: closed
Cleanup/optimization |

Component: Template system | Version: master
Severity: Normal | Resolution:
| worksforme
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Old description:

> https://github.com/django/django/pull/13597


>
> I've added code with this fix, and test for it

New description:

V

--

Comment (by Mikhail Fesenko):

Wow, I made a mistake =(
Idk why, when I did this patch, I thought that if option in options: was
only for 'with' param, idk why

--
Ticket URL: <https://code.djangoproject.com/ticket/32139#comment:4>

Django

unread,
Oct 25, 2020, 5:41:21 AM10/25/20
to django-...@googlegroups.com
#32139: Add check, that raise TemplateException, when argument 'only' provided more
then once in tag 'include'
-------------------------------------+-------------------------------------

Reporter: Mikhail Fesenko | Owner: nobody
Type: | Status: closed
Cleanup/optimization |

Component: Template system | Version: master
Severity: Normal | Resolution:
| worksforme
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Mikhail Fesenko:

Old description:

> V

New description:

https://github.com/django/django/pull/13597

I've added code with this fix, and test for it

--

--
Ticket URL: <https://code.djangoproject.com/ticket/32139#comment:5>

Reply all
Reply to author
Forward
0 new messages