mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Merge pull request #2922 from lholmquist/user_model
Update user model logic for Ember Inspector.
This commit is contained in:
commit
ae0ca259bf
1 changed files with 3 additions and 5 deletions
|
@ -41,12 +41,10 @@ var User = DS.Model.extend({
|
||||||
validationErrors.push({message: 'Location is too long'});
|
validationErrors.push({message: 'Location is too long'});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.get('website').length) {
|
|
||||||
if (!validator.isURL(this.get('website'), { protocols: ['http', 'https'], require_protocol: true }) ||
|
if (!validator.isURL(this.get('website'), { protocols: ['http', 'https'], require_protocol: true }) ||
|
||||||
!validator.isLength(this.get('website'), 0, 2000)) {
|
!validator.isLength(this.get('website'), 0, 2000)) {
|
||||||
validationErrors.push({message: 'Please use a valid url'});
|
validationErrors.push({message: 'Please use a valid url'});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return validationErrors;
|
return validationErrors;
|
||||||
}.property('name', 'bio', 'email', 'location', 'website'),
|
}.property('name', 'bio', 'email', 'location', 'website'),
|
||||||
|
|
Loading…
Add table
Reference in a new issue