Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#994 closed enhancement (fixed)

Edit Profile: It should be possible to add Website-URLs without "http://"

Reported by: markus Owned by:
Priority: trivial Milestone:
Component: programming Keywords:
Cc: berkerpeksag, Christopher Allan Webber Parent Tickets:

Description

Currently, if you want to add a website-url to your profile, you have to include the string "http://", otherwise you get an error stating "the url is in the wrong format". It should not be necessary to include "http://" in the url.

Attachments (3)

issue_994.patch (2.8 KB ) - added by Ben Sturmfels 9 years ago.
issue_994v2.patch (4.1 KB ) - added by Ben Sturmfels 9 years ago.
issue_994_test_fix.patch (896 bytes ) - added by Ben Sturmfels 9 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by markus, 10 years ago

Summary: Edit Profile: Adding Website-URL without "http://" not possibleEdit Profile: It should be possible to add Website-URLs without "http://"

comment:2 by Ben Sturmfels, 9 years ago

I've attached a patch to allow people to not enter the http:// or https:// part of the website URL. If it's not provided, a prefix of http:// will be used.

Regards,
Ben

by Ben Sturmfels, 9 years ago

Attachment: issue_994.patch added

comment:3 by ayleph, 9 years ago

Cc: berkerpeksag Christopher Allan Webber added
Status: newreview

Seems reasonable to me. If we're going to offer an explicit 'Website' box on the Edit Profile page, we might as well assume that a http(s) URI is going to be entered. CC'ing berker for review, and also cwebber in case he has any thoughts.

comment:4 by berkerpeksag, 9 years ago

+ if not (data.startswith(u'http://') or data.startswith(u'https://')):

or if not data.startswith((u'http://', u'https://')):

Could you also pass a description parameter to WebsiteField to explain the new behavior? So people will notice that they don't have to write the http:// part.

Thanks!

comment:5 by Ben Sturmfels, 9 years ago

Thanks Berker, I wasn't aware of that feature in startswith. I've also added a description with "www.example.com" to suggest that http:// part isn't required. What do you think?

by Ben Sturmfels, 9 years ago

Attachment: issue_994v2.patch added

comment:7 by Ben Sturmfels, 9 years ago

Hi Berker,

Thanks very much for merging this and also improving process_formdata to handle null/empty valuelist.

Unfortunately I think the other small tweak you made to the body broke the function for the case when there is already an http or https prefix, as shown in failing test test_edit.test_change_bio_url.

Patch attached.

Cheers,
Ben

by Ben Sturmfels, 9 years ago

Attachment: issue_994_test_fix.patch added
Note: See TracTickets for help on using tickets.