Skip to content

Refactor views projects #6171

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 4 commits into from
Sep 30, 2019
Merged

Conversation

stsewd
Copy link
Member

@stsewd stsewd 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 stsewd requested a review from a team September 12, 2019 00:15
Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

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

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):
Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

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

@stsewd stsewd merged commit a42f5d4 into readthedocs:master Sep 30, 2019
@stsewd stsewd deleted the refactor-views-projects branch September 30, 2019 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants