mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 03:44:29 +03:00
Updated name validation for offer to restrict to 40 chars
refs https://github.com/TryGhost/Team/issues/1236 Stripe allows coupon names to be only upto 40 chars long, while Ghost allowed them to be 191 chars. This change updates the admin validation to restrict name to 40 chars to match Stripe limit
This commit is contained in:
parent
67a10184dc
commit
7cd09eee96
@ -9,8 +9,8 @@ export default BaseValidator.create({
|
||||
model.errors.add('name', 'Please enter a name.');
|
||||
this.invalidate();
|
||||
}
|
||||
if (!validator.isLength(model.name || '', 0, 191)) {
|
||||
model.errors.add('name', 'Name cannot be longer than 191 characters.');
|
||||
if (!validator.isLength(model.name || '', 0, 40)) {
|
||||
model.errors.add('name', 'Name cannot be longer than 40 characters.');
|
||||
this.invalidate();
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user