bug fix => check if request is None before checking user, avoiding "AttributeError: 'NoneType' object has no attribute 'user'"