X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/5a54630b572d222b0abea05f3e19e1b1951f0aee..50224b473bce736436d27c64bd46c1910e4d43ec:/app/models/user.rb?ds=inline 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