"""
Convenience methods to avoid having to use hasattr, which
covers cases where the middleware isn't loaded / didn't load

Obviously you can still use request.brownlisted in your templates
"""

def is_whitelisted(request):
    return hasattr(request, 'whitelisted')
    
def is_brownlisted(request):
    return hasattr(request, 'brownlisted')    
1dc034fd30559593d39d2b9e7af81bf403783da3
<mask token>

<mask token>


def is_brownlisted(request):
    return hasattr(request, 'brownlisted')

<mask token>


def is_whitelisted(request):
    return hasattr(request, 'whitelisted')


def is_brownlisted(request):
    return hasattr(request, 'brownlisted')

"""
Convenience methods to avoid having to use hasattr, which
covers cases where the middleware isn't loaded / didn't load

Obviously you can still use request.brownlisted in your templates
"""

def is_whitelisted(request):
    return hasattr(request, 'whitelisted')
    
def is_brownlisted(request):
    return hasattr(request, 'brownlisted')    