示例#1
0
def url_is_location_safe(url):
    from corehq.apps.locations.permissions import is_location_safe
    try:
        match = resolve(url)
    except Resolver404:
        return False
    return is_location_safe(match.func, match.args, match.kwargs)
示例#2
0
def url_is_location_safe(url):
    from corehq.apps.locations.permissions import is_location_safe
    url = url.split(get_url_base())[-1] if url else None
    try:
        match = resolve(url)
    except Resolver404:
        return False
    return is_location_safe(match.func, match.args, match.kwargs)
示例#3
0
def url_is_location_safe(url):
    from corehq.apps.locations.permissions import is_location_safe
    url = url.split(get_url_base())[-1] if url else None
    try:
        match = resolve(url)
    except Resolver404:
        return False
    return is_location_safe(match.func, match.args, match.kwargs)
示例#4
0
def url_is_location_safe(url):
    from corehq.apps.locations.permissions import is_location_safe
    url = url.split(get_url_base())[-1] if url else None
    try:
        match = resolve(url)
    except Resolver404:
        return False
    # pass empty request, since we should exclude any url that requires request context
    return is_location_safe(match.func, None, match.args, match.kwargs)
示例#5
0
def url_is_location_safe(url):
    from corehq.apps.locations.permissions import is_location_safe
    url = url.split(get_url_base())[-1] if url else None
    try:
        match = resolve(url)
    except Resolver404:
        return False
    # pass empty request, since we should exclude any url that requires request context
    return is_location_safe(match.func, None, match.args, match.kwargs)