Fix core view auto-logout inactive user logic, for tests

This commit is contained in:
Lance Edgar 2017-03-27 22:44:51 -05:00
parent 97aa17f64d
commit 27903b5984

View file

@ -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()