about summary refs log tree commit diff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-05-19 21:40:36 +0200
committerEugen Rochko <eugen@zeonfederated.com>2019-05-19 21:40:36 +0200
commitae1838655876363065dd062a21064d385a90eb33 (patch)
tree27fb8d7cecb5b5ad79db1115a91968e5cfd07f7c /app/models/user.rb
parent37a04c329c2b859f6a3aeb11795aec1da2943160 (diff)
Fix “invited by” not showing up for invited accounts in admin interface (#10791)
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 6941b040d..3d1eb5f20 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -114,6 +114,10 @@ class User < ApplicationRecord
   end
 
   def invited?
+    invite_id.present?
+  end
+
+  def valid_invitation?
     invite_id.present? && invite.valid_for_use?
   end
 
@@ -274,7 +278,7 @@ class User < ApplicationRecord
   private
 
   def set_approved
-    self.approved = open_registrations? || invited? || external?
+    self.approved = open_registrations? || valid_invitation? || external?
   end
 
   def open_registrations?