summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2016-11-17 13:53:14 +0000
committerazul <azul@riseup.net>2016-11-17 13:53:14 +0000
commit6f1a49ec7e094191ff52f56d3a436aea81323ba1 (patch)
tree862898f476dccd5495be996a47492ef439ba3cab /app/models/user.rb
parent47c6bc5e62df9a7ad07cd975ea07113f6df4fedc (diff)
parenta4d17414fddbfe75c1d876717dc41937d02bde28 (diff)
Merge branch 'bugfix/error-dups' into 'master'
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 See merge request !10
Diffstat (limited to 'app/models/user.rb')
-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