Skip to content

Remove unused code from view and template #6250

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

Closed
stsewd opened this issue Oct 7, 2019 · 1 comment · Fixed by #6288
Closed

Remove unused code from view and template #6250

stsewd opened this issue Oct 7, 2019 · 1 comment · Fixed by #6288
Labels
Accepted Accepted issue on our roadmap Good First Issue Good for new contributors

Comments

@stsewd
Copy link
Member

stsewd commented Oct 7, 2019

Person isn't used, and we always expect to have tags in the context.

View

def get_queryset(self):
queryset = Project.objects.public(self.request.user)
queryset = queryset.exclude(users__profile__banned=True)
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'):
self.user = get_object_or_404(
User,
username=self.kwargs.get('username'),
)
queryset = queryset.filter(user=self.user)
else:
self.user = None
return queryset

Template
https://github.com/readthedocs/readthedocs.org/blob/master/readthedocs/templates/projects/project_list.html

Ref #6228 (comment)

@stsewd stsewd added Good First Issue Good for new contributors Accepted Accepted issue on our roadmap labels Oct 7, 2019
@thegtzz
Copy link

thegtzz commented Oct 13, 2019

hi, I'am new either in django or open source projects. What should I do with this issue exactly? Could you explain, please?

jaferkhan added a commit to jaferkhan/readthedocs.org that referenced this issue Oct 15, 2019
jaferkhan added a commit to jaferkhan/readthedocs.org that referenced this issue Oct 15, 2019
stsewd added a commit that referenced this issue Oct 16, 2019
Removed unused code from view and template (#6250)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Good First Issue Good for new contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants