X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/5a54630b572d222b0abea05f3e19e1b1951f0aee..b43f9c47145a14b547a900d9559f9aa3fd0895d1:/app/models/user.rb?ds=sidebyside diff --git a/app/models/user.rb b/app/models/user.rb index 23e95bc88..31b0f27a0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -56,8 +56,11 @@ class User < ActiveRecord::Base user = token.user if token end - if user - user = nil unless user.visible? and (user.active? or options[:inactive]) + if user and + ( user.status == "deleted" or + ( user.status == "pending" and not options[:pending] ) or + ( user.status == "suspended" and not options[:suspended] ) ) + user = nil end token.update_attribute(:expiry, 1.week.from_now) if token and user