mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-02-05 16:01:10 +00:00
Add a workaround for profile deletion
This commit is contained in:
parent
2a21f70603
commit
68de617f0e
1 changed files with 7 additions and 0 deletions
|
@ -85,6 +85,13 @@ class ApplicationController < ActionController::Base
|
||||||
Time.zone = cuser.time_zone
|
Time.zone = cuser.time_zone
|
||||||
cuser.update_attribute :lastvisit, Time.now.utc if cuser&.lastvisit < 2.minutes.ago.utc
|
cuser.update_attribute :lastvisit, Time.now.utc if cuser&.lastvisit < 2.minutes.ago.utc
|
||||||
|
|
||||||
|
# FIXME: there is a bug in steam auth that causes nil profile
|
||||||
|
unless cuser.profile&.present?
|
||||||
|
flash[:notice] = "Your profile has been removed and recreated."
|
||||||
|
cuser.build_profile
|
||||||
|
cuser.save
|
||||||
|
end
|
||||||
|
|
||||||
if cuser.banned? Ban::TYPE_SITE
|
if cuser.banned? Ban::TYPE_SITE
|
||||||
session[:user] = nil
|
session[:user] = nil
|
||||||
@cuser = nil
|
@cuser = nil
|
||||||
|
|
Loading…
Reference in a new issue