summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2016-11-17 14:49:16 +0100
committerAzul <azul@riseup.net>2016-11-17 14:49:16 +0100
commita4d17414fddbfe75c1d876717dc41937d02bde28 (patch)
tree862898f476dccd5495be996a47492ef439ba3cab /app/models
parent47c6bc5e62df9a7ad07cd975ea07113f6df4fedc (diff)
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
Diffstat (limited to 'app/models')
-rw-r--r--app/models/user.rb2
1 files changed, 1 insertions, 1 deletions
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