Repository: wagtail/wagtail
File: wagtail/admin/viewsets/model.py (Python)

Code before:
    def register_reference_index(self):
        if self.add_to_reference_index:
            ReferenceIndex.register_model(self.model)

    def get_permissions_to_register(self):
        """
        Returns a queryset of :class:`~django.contrib.auth.models.Permission`
        objects to be registered with the :ref:`register_permissions` hook. By
        default, it returns all permissions for the model if
        :attr:`inspect_view_enabled` is set to ``True``. Otherwise, the "view"
        permission is excluded.
        """
        content_type = ContentType.objects.get_for_model(self.model)
        permissions = Permission.objects.filter(content_type=content_type)
        # Only register the "view" permission if the inspect view is enabled
        if not self.inspect_view_enabled:
            permissions = permissions.exclude(
                codename=get_permission_codename("view", self.model_opts)
            )
        return permissions

    def register_permissions(self):
        hooks.register("register_permissions", self.get_permissions_to_register)

    def get_urlpatterns(self):
        conv = self.url_converter
        urlpatterns = [
            path("", self.index_view, name="index"),
            path("results/", self.index_results_view, name="index_results"),
            path("new/", self.add_view, name="add"),
            path(f"edit/<{conv}:pk>/", self.edit_view, name="edit"),
            path(f"delete/<{conv}:pk>/", self.delete_view, name="delete"),
            path(
                f"history/<{conv}:pk>/",
                self.history_view,
                name="history",
            ),
            path(
                f"history-results/<{conv}:pk>/",
                self.history_results_view,
                name="history_results",
            ),
            path(f"usage/<{conv}:pk>/", self.usage_view, name="usage"),
        ]

        if self.reorder_view_enabled:
            urlpatterns.append(
                path(
                    f"reorder/<{conv}:pk>/",
                    self.reorder_view,
                    name="reorder",

Review comment (suggestion):
```suggestion
        conv = self.pk_path_converter
```

Code after:
                "permission_policy": self.permission_policy,
                "edit_url_name": self.get_url_name("edit"),
            },
        )

    def register_admin_url_finder(self):
        register_admin_url_finder(self.model, self.url_finder_class)

    def register_reference_index(self):
        if self.add_to_reference_index:
            ReferenceIndex.register_model(self.model)

    def get_permissions_to_register(self):
        """
        Returns a queryset of :class:`~django.contrib.auth.models.Permission`
        objects to be registered with the :ref:`register_permissions` hook. By
        default, it returns all permissions for the model if
        :attr:`inspect_view_enabled` is set to ``True``. Otherwise, the "view"
        permission is excluded.
        """
        content_type = ContentType.objects.get_for_model(self.model)
        permissions = Permission.objects.filter(content_type=content_type)
        # Only register the "view" permission if the inspect view is enabled
        if not self.inspect_view_enabled:
            permissions = permissions.exclude(
                codename=get_permission_codename("view", self.model_opts)
            )
        return permissions

    def register_permissions(self):
        hooks.register("register_permissions", self.get_permissions_to_register)

    def get_urlpatterns(self):
        conv = self.pk_path_converter
        urlpatterns = [
            path("", self.index_view, name="index"),
            path("results/", self.index_results_view, name="index_results"),
            path("new/", self.add_view, name="add"),
            path(f"edit/<{conv}:pk>/", self.edit_view, name="edit"),
            path(f"delete/<{conv}:pk>/", self.delete_view, name="delete"),
            path(f"history/<{conv}:pk>/", self.history_view, name="history"),
            path(
                f"history-results/<{conv}:pk>/",
                self.history_results_view,
                name="history_results",
            ),
            path(f"usage/<{conv}:pk>/", self.usage_view, name="usage"),
        ]

        if self.reorder_view_enabled:
            urlpatterns.append(