Add comment
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Râu Cao 2023-04-06 16:25:01 +02:00
parent bb82b6b462
commit 7a193d6647
Signed by: raucao
GPG Key ID: 15E65F399D084BA9

View File

@ -22,6 +22,7 @@ class User < ApplicationRecord
validates_format_of :cn, without: /\A-/, validates_format_of :cn, without: /\A-/,
if: Proc.new{ |u| u.cn.present? }, if: Proc.new{ |u| u.cn.present? },
message: "is invalid. Usernames need to start with a letter." message: "is invalid. Usernames need to start with a letter."
# FIXME This needs a server restart to apply values
validates_format_of :cn, without: /\A(#{Setting.reserved_usernames.join('|')})\z/i, validates_format_of :cn, without: /\A(#{Setting.reserved_usernames.join('|')})\z/i,
message: "has already been taken" message: "has already been taken"