Bug #6765
closedcreating a medium with single whitespace(" ") shouldn't be allowed
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1121972
Description of problem:
I was trying to create media with single white space in quotes (" ") and it was created successfully. However when I increase the the whitespace, UI throws error:
can't be blank or contain trailing white spaces.
so UI should throw same error while creating media with single whitespace.
Version-Release number of selected component (if applicable):
sat6 GA snap1
How reproducible:
always
Steps to Reproduce:
1. create a media with single while space in quotes in name
2.
3.
Actual results:
media created successfully
Expected results:
UI should throw error:
can't be blank or contain trailing white spaces.
Additional info:
logs from production.log
Processing by MediaController#create as /*
Parameters: {"utf8"=>"✓", "search"=>"", "authenticity_token"=>"VX+UKFuIgqWyHwxAdhnLIrzFLAmDgGh5qENjFuLnsso=", "medium"=>{"name"=>"\" \"", "path"=>"http://mirror.fakeos.org/G8/$major.$minor/os/$arch", "media_path"=>"", "config_path"=>"", "image_path"=>"", "os_family"=>"", "location_ids"=>[""], "organization_ids"=>[""]}}
Redirected to https://dhcp201-195.englab.pnq.redhat.com/media
Completed 302 Found in 29ms (ActiveRecord: 10.3ms)
Processing by MediaController#index as */
Rendered media/index.html.erb within layouts/application (91.4ms)
Rendered common/_searchbar.html.erb (3.5ms)
Rendered home/_user_dropdown.html.erb (1.5ms)
Read fragment views/tabs_and_title_records-3 (0.1ms)
Rendered home/_topbar.html.erb (2.4ms)
Rendered layouts/base.html.erb (3.9ms)
Completed 200 OK in 112ms (Views: 99.6ms | ActiveRecord: 2.1ms)
Updated by Dominic Cleal over 10 years ago
- Category set to Rails
We seem to have many variations of name validators, it's probably time to just create a custom validator which is covered well by unit tests, and apply it consistently across the application.
Updated by Dominic Cleal over 10 years ago
- Related to Bug #5923: ptable validation trailing spaces incorrectly allows one space added
Updated by Tomer Brisker about 10 years ago
- Status changed from New to Assigned
- Assignee set to Tomer Brisker
Updated by The Foreman Bot about 10 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/1941 added
- Pull request deleted (
)
Updated by Tomer Brisker about 10 years ago
- Related to Refactor #8414: Extract repeating validators from models added
Updated by Anonymous about 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset d3d17516a5b2b92c357a756fef2f18599f919a76.
Updated by Dominic Cleal about 10 years ago
- Translation missing: en.field_release set to 29