mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
fix validation
This commit is contained in:
parent
4e1bf0f73d
commit
4e46043aae
1 changed files with 1 additions and 1 deletions
|
@ -75,7 +75,7 @@ class Site < Sequel::Model
|
||||||
# Check for existing user
|
# Check for existing user
|
||||||
|
|
||||||
user = self.class.select(:username).filter(username: values[:username]).first
|
user = self.class.select(:username).filter(username: values[:username]).first
|
||||||
if !user.nil? && (user.id != values[:id])
|
if !user.nil? || (!new? && user.id != values[:id])
|
||||||
errors.add :username, 'This username is already taken. Try using another one.'
|
errors.add :username, 'This username is already taken. Try using another one.'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue