[Django] #29143: IntConverter does not accept negative integers

6 views
Skip to first unread message

Django

unread,
Feb 19, 2018, 10:24:17 AM2/19/18
to django-...@googlegroups.com
#29143: IntConverter does not accept negative integers
-------------------------------------+-------------------------------------
Reporter: Ashish | Owner: nobody
Patil |
Type: Bug | Status: assigned
Component: Core | Version: 2.0
(URLs) | Keywords:
Severity: Normal | IntConverter,url,path
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
Paths like
{{{
'/int/<int:integer>/'
}}}
do not accept negative integers, i.e.
{{{
'/int/-2/'
}}}
fails with a 404, which it should not (since -2 ''is'' an integer).

PS - Attributed to this StackOverflow question for discovery and potential
fix : https://stackoverflow.com/questions/48867977/django-2-url-path-
matching-negative-value

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

Django

unread,
Feb 19, 2018, 10:25:55 AM2/19/18
to django-...@googlegroups.com
#29143: IntConverter does not accept negative integers
-------------------------------------+-------------------------------------
Reporter: Ashish Patil | Owner: nobody
Type: Bug | Status: assigned
Component: Core (URLs) | Version: 2.0
Severity: Normal | Resolution:
Keywords: | Triage Stage:
IntConverter,url,path | Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ashish Patil):

* Attachment "NegativeIntConverter.patch" added.

Django

unread,
Feb 19, 2018, 10:28:58 AM2/19/18
to django-...@googlegroups.com
#29143: IntConverter does not accept negative integers
-------------------------------------+-------------------------------------
Reporter: Ashish Patil | Owner: Ashish

| Patil
Type: Bug | Status: assigned
Component: Core (URLs) | Version: 2.0
Severity: Normal | Resolution:
Keywords: | Triage Stage:
IntConverter,url,path | Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ashish Patil):

* owner: nobody => Ashish Patil


--
Ticket URL: <https://code.djangoproject.com/ticket/29143#comment:1>

Django

unread,
Feb 19, 2018, 10:43:52 AM2/19/18
to django-...@googlegroups.com
#29143: IntConverter does not accept negative integers
-------------------------------------+-------------------------------------
Reporter: Ashish Nitin Patil | Owner: (none)
Type: Bug | Status: new

Component: Core (URLs) | Version: 2.0
Severity: Normal | Resolution:
Keywords: | Triage Stage:
IntConverter,url,path | Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ashish Nitin Patil):

* status: assigned => new
* owner: Ashish Nitin Patil => (none)


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

Django

unread,
Feb 19, 2018, 10:55:16 AM2/19/18
to django-...@googlegroups.com
#29143: IntConverter does not accept negative integers
-------------------------------------+-------------------------------------
Reporter: Ashish Nitin Patil | Owner: (none)
Type: Bug | Status: closed

Component: Core (URLs) | Version: 2.0
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage:
IntConverter,url,path | Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

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


Comment:

This is intended behavior consistent
[https://docs.djangoproject.com/en/dev/topics/http/urls/#path-converters
with the documentation], "Matches zero or any positive integer".

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

Reply all
Reply to author
Forward
0 new messages