Opened 7 years ago

Closed 7 years ago

#29311 closed Cleanup/optimization (duplicate)

Ease customizing URLField validation

Reported by: Arthur Pemberton Owned by: nobody
Component: Database layer (models, ORM) Version: 2.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Example URL: "myscheme://server/group-name/item-name"

Problem 1: models.URLField needs to be subclassed to change allowed schemes
Problem 2: forms.URLField needs to be subclassed to change allowed schemes
Problem 3: validators.URLValidator needs to be subclassed to change regex to allow netloc that is a hostname without a domain ad TLD

At the very least, making these changes should be documented better. The message accompanying ValidationError gives no hint as to the source issue with a URL.

Change History (1)

comment:1 by Tim Graham, 7 years ago

Component: UncategorizedDatabase layer (models, ORM)
Resolution: duplicate
Status: newclosed
Summary: URLField is too strict, doesn't allow other valid URLsEase customizing URLField validation
Type: BugCleanup/optimization

Duplicate of #25594.

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