Skip to content

remove /projects/ #6228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions readthedocs/projects/urls/public.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@
from readthedocs.builds import views as build_views
from readthedocs.constants import pattern_opts
from readthedocs.projects.views import public
from readthedocs.projects.views.public import ProjectDetailView, ProjectIndex
from readthedocs.projects.views.public import ProjectDetailView, ProjectTagIndex
from readthedocs.search import views as search_views


urlpatterns = [
url(
r'^$',
ProjectIndex.as_view(),
name='projects_list',
),
url(
r'^(?P<invalid_project_slug>{project_slug}_{project_slug})/'.format(**pattern_opts),
public.project_redirect,
Expand Down Expand Up @@ -78,7 +73,7 @@
),
url(
r'^tags/(?P<tag>[-\w]+)/$',
ProjectIndex.as_view(),
ProjectTagIndex.as_view(),
name='projects_tag_detail',
),
]
9 changes: 3 additions & 6 deletions readthedocs/projects/views/public.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
mimetypes.add_type('application/epub+zip', '.epub')


class ProjectIndex(ListView):
class ProjectTagIndex(ListView):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just noting that this change will require a corresponding change to the private Read the Docs corporate repository.


"""List view of public :py:class:`Project` instances."""

Expand All @@ -47,11 +47,8 @@ def get_queryset(self):
queryset = Project.objects.public(self.request.user)
queryset = queryset.exclude(users__profile__banned=True)

if self.kwargs.get('tag'):
self.tag = get_object_or_404(Tag, slug=self.kwargs.get('tag'))
queryset = queryset.filter(tags__slug__in=[self.tag.slug])
else:
self.tag = None
self.tag = get_object_or_404(Tag, slug=self.kwargs.get('tag'))
queryset = queryset.filter(tags__slug__in=[self.tag.slug])

if self.kwargs.get('username'):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem like this is used anymore. As a separate change in a separate PR, this could probably be removed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.user = get_object_or_404(
Expand Down