From a4d17414fddbfe75c1d876717dc41937d02bde28 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 17 Nov 2016 14:49:16 +0100 Subject: bugfix: only send login errors once If a login was invalid as a username but also for the identity we used to have duplicate error messages. Let's avoid that. Also added a test to make sure invite_code errors are properly displayed no matter what other fields are set or missing. Pixelated will rely on this to test invite codes --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/user.rb b/app/models/user.rb index 9cebbca..259778b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -230,7 +230,7 @@ class User < CouchRest::Model::Base def identity_is_valid return if identity.valid? identity.errors.each do |attribute, error| - self.errors.add(:login, error) + errors.add(:login, error) unless errors[:login].include? error end end -- cgit v1.2.3