Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)