Skip to content

Commit

Permalink
Update user model logic for Ember Inspector.
Browse files Browse the repository at this point in the history
Fixes #2921.
  • Loading branch information
lholmquist committed Jun 9, 2014
1 parent 4406d35 commit b90f322
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions core/client/models/user.js
Expand Up @@ -41,11 +41,9 @@ var User = DS.Model.extend({
validationErrors.push({message: 'Location is too long'});
}

if (this.get('website').length) {
if (!validator.isURL(this.get('website'), { protocols: ['http', 'https'], require_protocol: true }) ||
!validator.isLength(this.get('website'), 0, 2000)) {
validationErrors.push({message: 'Please use a valid url'});
}
if (!validator.isURL(this.get('website'), { protocols: ['http', 'https'], require_protocol: true }) ||
!validator.isLength(this.get('website'), 0, 2000)) {
validationErrors.push({message: 'Please use a valid url'});
}

return validationErrors;
Expand Down

0 comments on commit b90f322

Please sign in to comment.