diff options
author | ThibG <thib@sitedethib.com> | 2019-05-19 22:07:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-19 22:07:42 +0200 |
commit | 0998e3ade8b03174c0a69ba4f78b31f92ccc1ade (patch) | |
tree | f163dea0261fa79ca2052cd243ec9ac502b53cd2 /app/models | |
parent | 46811f92e4b1705da5bb52e0e9e4e9e59ea1a15e (diff) | |
parent | 08a2af27c3353555d729255fc42f6d49af20ed52 (diff) |
Merge pull request #1055 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/user.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index a245d3eb2..496cb0b1b 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? |