Fix core view auto-logout inactive user logic, for tests
This commit is contained in:
parent
97aa17f64d
commit
27903b5984
|
@ -45,9 +45,12 @@ class View(object):
|
|||
|
||||
def __init__(self, request):
|
||||
self.request = request
|
||||
if request.user and not request.user.active:
|
||||
|
||||
# if user becomes inactive while logged in, log them out
|
||||
if getattr(request, 'user', None) and not request.user.active:
|
||||
headers = logout_user(request)
|
||||
raise self.redirect(request.route_url('home'))
|
||||
|
||||
config = self.rattail_config
|
||||
if config:
|
||||
self.enum = config.get_enum()
|
||||
|
|
Loading…
Reference in a new issue