Convenience function for redirecting users who don't have access to a page to the home page.
    Parameters:
        request - the request in the calling function
        message - a message from the caller function

def red_home(request, message=None):
    '''
    Convenience function for redirecting users who don't have access to a page to the home page.
    Parameters:
        request - the request in the calling function
        message - a message from the caller function
    '''
    if message:
        messages.add_message(request, messages.ERROR, message)
    return HttpResponseRedirect(reverse('homepage'))