Skip to content

Commit ad429a3

Browse files
authored
Merge pull request #6288 from jaferkhan/remove-unused-code
Removed unused code from view and template (#6250)
2 parents 2445f46 + 7b7b059 commit ad429a3

File tree

2 files changed

+2
-36
lines changed

2 files changed

+2
-36
lines changed

readthedocs/projects/views/public.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,10 @@ def get_queryset(self):
5555
self.tag = get_object_or_404(Tag, slug=self.kwargs.get('tag'))
5656
queryset = queryset.filter(tags__slug__in=[self.tag.slug])
5757

58-
if self.kwargs.get('username'):
59-
self.user = get_object_or_404(
60-
User,
61-
username=self.kwargs.get('username'),
62-
)
63-
queryset = queryset.filter(user=self.user)
64-
else:
65-
self.user = None
66-
6758
return queryset
6859

6960
def get_context_data(self, **kwargs):
7061
context = super().get_context_data(**kwargs)
71-
context['person'] = self.user
7262
context['tag'] = self.tag
7363
return context
7464

readthedocs/templates/projects/project_list.html

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,13 @@
44
{% load pagination_tags %}
55

66
{% block title %}
7-
{% if person %}
8-
{% if tag %}
9-
{% blocktrans with person.username as username and tag.name as tag %}Projects by {{ username }} tagged with {{ tag }}{% endblocktrans %}
10-
{% else %}
11-
{% blocktrans with person.username as username %}Projects by {{ username }}{% endblocktrans %}
12-
{% endif %}
13-
{% else %}
14-
{% if tag %}
15-
{% blocktrans with tag.name as tag %}Projects tagged with {{ tag }}{% endblocktrans %}
16-
{% else %}
17-
{% trans "Projects" %}
18-
{% endif %}
19-
{% endif %}
7+
{% blocktrans with tag.name as tag %}Projects tagged with {{ tag }}{% endblocktrans %}
208
{% endblock %}
219

2210
{% block nav-browse %}class="active"{% endblock %}
2311

2412
{% block content-header %}
25-
{% if person %}
26-
{% if tag %}
27-
<h1>{% blocktrans with person.username as username and tag.name as tag %}Projects by {{ username }} tagged with {{ tag }}{% endblocktrans %}</h1>
28-
{% else %}
29-
<h1>{% blocktrans with person.username as username %}Projects by {{ username }}{% endblocktrans %}</h1>
30-
{% endif %}
31-
{% else %}
32-
{% if tag %}
33-
<h1>{% blocktrans with tag.name as tag %}Projects tagged with {{ tag }}{% endblocktrans %}</h1>
34-
{% else %}
35-
<h1>{% trans "Projects" %}</h1>
36-
{% endif %}
37-
{% endif %}
13+
<h1>{% blocktrans with tag.name as tag %}Projects tagged with {{ tag }}{% endblocktrans %}</h1>
3814
{% endblock %}
3915

4016
{% block content %}

0 commit comments

Comments
 (0)