From 8d3b245c17f7dd616a52d03491ac9f233511a03c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Kooi?= Date: Fri, 7 Apr 2017 11:05:02 +0200 Subject: [PATCH] Show a more useful error message when the User slug is empty, fixes #88 (#101) --- src/models/User.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/User.js b/src/models/User.js index 63c41bdc..18ecdaab 100644 --- a/src/models/User.js +++ b/src/models/User.js @@ -38,7 +38,7 @@ export default function userModel() { slug: { type: String, unique: true, - required: true, + required: [true, 'Usernames must not consist of punctuation only.'], index: true }, level: { type: Number, min: 0, max: 9001, default: 0 },