Opened 6 years ago

Closed 6 years ago

#29143 closed Bug (invalid)

IntConverter does not accept negative integers

Reported by: Ashish Nitin Patil Owned by:
Component: Core (URLs) Version: 2.0
Severity: Normal Keywords: IntConverter, url, path
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

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

Attachments (1)

NegativeIntConverter.patch (1.7 KB ) - added by Ashish Nitin Patil 6 years ago.

Download all attachments as: .zip

Change History (4)

by Ashish Nitin Patil, 6 years ago

Attachment: NegativeIntConverter.patch added

comment:1 by Ashish Nitin Patil, 6 years ago

Owner: changed from nobody to Ashish Nitin Patil

comment:2 by Ashish Nitin Patil, 6 years ago

Owner: Ashish Nitin Patil removed
Status: assignednew

comment:3 by Tim Graham, 6 years ago

Resolution: invalid
Status: newclosed

This is intended behavior consistent with the documentation, "Matches zero or any positive integer".

Note: See TracTickets for help on using tickets.
Back to Top