tango_with_django_19 icon indicating copy to clipboard operation
tango_with_django_19 copied to clipboard

Adding url without "http://" is considered not a URL

Open daydream05 opened this issue 8 years ago • 5 comments

Even with cleaning the data provided, it's still saved as the original input

def clean(self):
    cleaned_data = self.cleaned_data
    url = cleaned_data.get('url')

    # if url is not empty and doesn't start with 'http://'

    if url and not url.startswith('http://'):
        url = 'http://' + url
        cleaned_data['url'] = url

        return cleaned_data

daydream05 avatar Aug 22 '16 19:08 daydream05

Thanks - we'll have to look into this..

leifos avatar Oct 20 '16 16:10 leifos

It is working fine for me

leonnardo avatar Oct 27 '16 19:10 leonnardo

Hi Vince, Hi All,

Vince, what browser/os/python/django are you using?

Also, check your code to make sure the indentation is correct - so that the method is within the PageForm.

Leif

On 4 Nov 2016, at 13:41, yamei [email protected] wrote:

So do I as leonnardo

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/leifos/tango_with_django_19/issues/32#issuecomment-258433812, or mute the thread https://github.com/notifications/unsubscribe-auth/AB02B0gTmQKGVQJsvo4Z9rc11nTDgIeQks5q6zYQgaJpZM4JqPHV.

leifos avatar Nov 06 '16 12:11 leifos

For me, "https://" is not being accepted. Only "http://" is.

NinjaOnRails avatar Jun 26 '17 21:06 NinjaOnRails

Hi @leifos , I got the same problem . I'm working on OS X El Capitan. Chrome, Python 3.6.1, Django==1.9

vankhoa011 avatar Nov 03 '17 02:11 vankhoa011