Project

General

Profile

Actions

Bug #6765

closed

creating a medium with single whitespace(" ") shouldn't be allowed

Added by Dominic Cleal almost 10 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rails
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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)


Related issues 2 (0 open2 closed)

Related to Foreman - Bug #5923: ptable validation trailing spaces incorrectly allows one spaceClosedJoseph Magen05/25/2014Actions
Related to Foreman - Refactor #8414: Extract repeating validators from modelsClosedTomer Brisker11/16/2014Actions
Actions #1

Updated by Dominic Cleal almost 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.

Actions #2

Updated by Dominic Cleal almost 10 years ago

  • Related to Bug #5923: ptable validation trailing spaces incorrectly allows one space added
Actions #3

Updated by Tomer Brisker over 9 years ago

  • Status changed from New to Assigned
  • Assignee set to Tomer Brisker
Actions #4

Updated by The Foreman Bot over 9 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/1941 added
  • Pull request deleted ()
Actions #5

Updated by Tomer Brisker over 9 years ago

  • Related to Refactor #8414: Extract repeating validators from models added
Actions #6

Updated by Anonymous over 9 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #7

Updated by Dominic Cleal over 9 years ago

  • translation missing: en.field_release set to 29
Actions

Also available in: Atom PDF