Opened 9 years ago

Closed 9 years ago

#24832 closed Bug (invalid)

URLField validation isn't very strict

Reported by: Tom Carrick Owned by: nobody
Component: Database layer (models, ORM) Version: 1.8
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


When getting a URL from twitter and putting it in the database, I accidentally got all the URLs instead of just the one I wanted, and stored it directly in the database, as json:

{'display_url': '', 'expanded_url': '', 'url': '', 'indices': [88, 110]}.

I didn't get any errors along the way, and it stored it just fine.

I'm not sure if it's intentional that the validator is lax here - the docs don't really specify if the URL has to be valid - but I thought I'd best report it in any case.

Change History (1)

comment:1 by Tom Carrick, 9 years ago

Resolution: invalid
Status: newclosed

Closing, I forgot that models don't validate on save().

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