#32954: Improve error message with URLValidator and schemes
-------------------------------------+-------------------------------------
               Reporter:  tomdjango  |          Owner:  nobody
                   Type:             |         Status:  new
  Cleanup/optimization               |
              Component:             |        Version:  3.2
  Uncategorized                      |
               Severity:  Normal     |       Keywords:  error message
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 If you limit the schemes for a URL to a subset of legal values with
 URLValidator, like this:

     url = models.URLField(max_length=200,
 validators=[URLValidator(["http","https"])])

 And then enter a value URL starting with "ftp://";, the error message given
 is

     Enter a valid URL.

 The URL is valid, so this does not give the user useful information for
 fixing the problem.  Something like

     URL must begin with one of [http, https]

 would be more helpful.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.130c1c90312e5ed6a4a26a47c764e6d1%40djangoproject.com.

Reply via email to