Changeset View
Changeset View
Standalone View
Standalone View
swh/web/common/identifiers.py
Show First 20 Lines • Show All 283 Lines • ▼ Show 20 Lines | for swh_object in swh_objects: | ||||
or extra_context["root_directory"] != object_id | or extra_context["root_directory"] != object_id | ||||
) | ) | ||||
): | ): | ||||
swhid_context["anchor"] = get_swh_persistent_id( | swhid_context["anchor"] = get_swh_persistent_id( | ||||
DIRECTORY, extra_context["root_directory"] | DIRECTORY, extra_context["root_directory"] | ||||
) | ) | ||||
path = None | path = None | ||||
if extra_context and "path" in extra_context: | if extra_context and "path" in extra_context: | ||||
path = extra_context["path"] | path = extra_context["path"] or "/" | ||||
if "filename" in extra_context and object_type == CONTENT: | if "filename" in extra_context and object_type == CONTENT: | ||||
path += extra_context["filename"] | path += extra_context["filename"] | ||||
if path: | if path: | ||||
swhid_context["path"] = quote(path, safe="/?:@&") | swhid_context["path"] = quote(path, safe="/?:@&") | ||||
swhid = get_swh_persistent_id(object_type, object_id) | swhid = get_swh_persistent_id(object_type, object_id) | ||||
swhid_url = reverse("browse-swh-id", url_args={"swh_id": swhid}) | swhid_url = reverse("browse-swh-id", url_args={"swh_id": swhid}) | ||||
Show All 22 Lines |