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

Remove duplication of get_downloads #1600

Closed
takotuesday opened this Issue Aug 26, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@takotuesday
Contributor

takotuesday commented Aug 26, 2015

These seem to be duplicate implementations:
https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/builds/models.py#L167

and

https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/projects/models.py#L422

It appears that the only implementation of get_downloads used, is within the Version class:
https://github.com/rtfd/readthedocs.org/search?utf8=%E2%9C%93&q=get_downloads

Is this legacy code that could be refactored?

@gregmuellegger

This comment has been minimized.

Show comment
Hide comment
@gregmuellegger

gregmuellegger Sep 7, 2015

Contributor

The Project.get_downloads is still used here:

bundle.data['downloads'] = bundle.obj.get_downloads()

So I think we cannot remove one of the implementations.

Contributor

gregmuellegger commented Sep 7, 2015

The Project.get_downloads is still used here:

bundle.data['downloads'] = bundle.obj.get_downloads()

So I think we cannot remove one of the implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment