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
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 Sep 12, 2019
Copy link
Member

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

@humitos humitos Sep 30, 2019

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

@stsewd stsewd Sep 30, 2019

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.

readthedocs/projects/views/private.py Show resolved Hide resolved
@stsewd stsewd merged commit a42f5d4 into readthedocs:master Sep 30, 2019
2 checks passed
@stsewd stsewd deleted the 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
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants