Skip to content
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

Refactor views projects #6171

Merged
merged 4 commits into from Sep 30, 2019

Conversation

@stsewd
Copy link
Member

commented Sep 11, 2019

Moved from a function view to a class based view, and also putting some common pieces under a base class.

Ref #5856

stsewd added 2 commits Sep 11, 2019
DRY
@stsewd stsewd requested a review from readthedocs/core Sep 12, 2019
Copy link
Member

left a comment

Everything looks good to me.

Left some comments and questions.

@@ -111,38 +111,53 @@ def get_context_data(self, **kwargs):
return context


class ProjectUpdate(ProjectSpamMixin, PrivateViewMixin, UpdateView):
class ProjectMixin(PrivateViewMixin):

This comment has been minimized.

Copy link
@humitos

humitos Sep 30, 2019

Member

Just with the name of the class, I'm not 100% sure if all the Project views need to inherit from this class or not. I guess, yes. Although, it may be good to reflect what the mixin is about in the name of the class, or if that's tricky, in a docstring.

This comment has been minimized.

Copy link
@stsewd

stsewd Sep 30, 2019

Author Member

All of them inherit this mixin but ProjectDasboard, because it's very different, it doesn't share anything in common.

readthedocs/projects/views/private.py Show resolved Hide resolved
@stsewd stsewd merged commit a42f5d4 into readthedocs:master Sep 30, 2019
2 checks passed
2 checks passed
continuous-documentation/read-the-docs Read the Docs build succeeded!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@stsewd stsewd deleted the stsewd:refactor-views-projects branch Sep 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.