Project

General

Profile

Bug #1638

When editing a user and adding/editing the email address, trailing whitespace causes an input validation error.

Added by Brian Gupta almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Difficulty:
trivial
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

We can probably be a bit smarter about this and ignore leading and trailing whitespace.

Associated revisions

Revision fe728c74 (diff)
Added by Ohad Levy almost 11 years ago

fixes #1638 - remove whitespaces for user email instead of validation error

History

#1 Updated by Ohad Levy almost 11 years ago

sure, this sounds like a simple before_save callback, with sometihng like

before_save :normalize_email

private

def normalize_email
  self.email.strip! # or whatever is needed to fix the string
end

#2 Updated by Ohad Levy almost 11 years ago

also worth mentioning that it would be great to have a simple unit test which compares the two scenarios (see test/unit/user.rb)

#3 Updated by Ohad Levy almost 11 years ago

  • Difficulty set to trivial

#4 Updated by Ohad Levy almost 11 years ago

  • Assignee set to Ohad Levy
  • Target version set to 1.0

#5 Updated by Ohad Levy almost 11 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF