Code

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#9713 closed (wontfix)

No verification of URL validity on django.db.models.fields.URLField

Reported by: masklinn Owned by: nobody
Component: Documentation Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The documentation for URLField states, for the verify_exists kwarg, If True (the default), the URL given will be checked for existence (i.e., the URL actually loads and doesn't give a 404 response).

But this validation doesn't seem to happen and, indeed, nothing in the URLField code performs any verification of the URL's validity.

The forms URLField on the other hand does perform URL verification and validation on verify_exists.

I'm not sure whether it's a case of overreaching documentation or of something that wasill be checked for existence (i.e., the URL actually loads and doesn't give a 404 response).

But this validation doesn't seem to happen and, indeed, nothing in the URLField code performs any verification of the URL's validity.

The forms URLField on the other hand does perform URL verification and validation on verify_exists as documented.

I'm not sure whether it's a case of overreaching documentation or of something that was supposed to be included in t supposed to be included in the code but wasn't or was removed, so I marked this as a doc bug.

Attachments (0)

Change History (4)

comment:1 Changed 6 years ago by ubernostrum

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

Model fields don't currently perform any sort of validation; form fields generated from them do. Hence, a form generated from your model will include the validation for the URLField.

comment:2 Changed 6 years ago by masklinn

  • Resolution invalid deleted
  • Status changed from closed to reopened

I have no problem with that, but the documentation is still wrong as it clearly implies that the model itself will perform the validation, without saying that one has to use an intermediate form.

comment:3 Changed 6 years ago by ubernostrum

  • Resolution set to wontfix
  • Status changed from reopened to closed

Noting every place where a constraint is only handled at the form level would create too many spurious documentation changes for no good reason, especially since model-level validation is slated for inclusion in the Django 1.1 release.

comment:4 Changed 5 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.