BootSourceSettings Model uses URLField and BootSourceSettingsForm does not (it uses CharField, which can be any string). So the form doesn't strip() nor does it check for URL formatting, then it tries to save() it into the Model and boom.
As an aside: I've noticed our Forms don't use any 'stripping' CharField (the default CharField doesn't do it for obvious reasons). Many of our string form fields SHOULD strip surrounding whitespace, since many of them are file paths, names, etc. Non-stripped whitespace could cause lots of problems, and even if it is user error, we should use the forms to clean these inputs up.
I've created and employed one for the other field on this Form (boot_source_keyring, since it's a file path and shouldn't start or end with spaces).
BootSourceSettings Model uses URLField and BootSourceSetti ngsForm does not (it uses CharField, which can be any string). So the form doesn't strip() nor does it check for URL formatting, then it tries to save() it into the Model and boom.
As an aside: I've noticed our Forms don't use any 'stripping' CharField (the default CharField doesn't do it for obvious reasons). Many of our string form fields SHOULD strip surrounding whitespace, since many of them are file paths, names, etc. Non-stripped whitespace could cause lots of problems, and even if it is user error, we should use the forms to clean these inputs up.
I've created and employed one for the other field on this Form (boot_source_ keyring, since it's a file path and shouldn't start or end with spaces).