Skip to content

Use ServeDocsPermissionsMixin to isolate this methods and be more clear #6408

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
wants to merge 5 commits into from

Conversation

humitos
Copy link
Member

@humitos humitos commented Nov 26, 2019

Small refactor to make more clear where these method come from.

@humitos humitos requested a review from ericholscher November 26, 2019 11:45
@humitos humitos added this to the Refactoring milestone Nov 26, 2019
@humitos humitos force-pushed the humitos/use-doc-permission-mixin branch from 3689847 to 60b121f Compare November 26, 2019 12:28
@stale
Copy link

stale bot commented Jan 10, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Jan 10, 2020

:rtype: django.http.HttpResponse
"""
return self._serve_401(request, project)
Copy link
Member

Choose a reason for hiding this comment

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

I don't quite understand what this is meant to be doing. Are we using these additional methods, or are they just meant to be overwritten?

Copy link
Member Author

Choose a reason for hiding this comment

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

We are overriding these methods from corporate. They are meant to be overwritten.

This PR just move them outside the main class and put them into a mixin with better docstrings. Which is easier to understand where they come from. That's all.

I could move the docstrings to the Base class, otherwise.

Copy link
Member

Choose a reason for hiding this comment

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

@humitos I think I ended up doing most of this PR in #6572 -- we should get this merged and combined with that one 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

@ericholscher see https://github.com/readthedocs/readthedocs.org/pull/6572/files#r371770894

I'm fine with either. I think defaulting to False and force re-define it, it's safer, though.

Copy link
Member

Choose a reason for hiding this comment

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

Yea, it should default False 👍

@stale stale bot removed the Status: stale Issue will be considered inactive soon label Jan 16, 2020
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

Looks good, likely need to be updated w/ the changes from #6572.


:rtype: django.http.HttpResponse
"""
return self._serve_401(request, project)
Copy link
Member

Choose a reason for hiding this comment

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

@humitos I think I ended up doing most of this PR in #6572 -- we should get this merged and combined with that one 👍


:rtype: django.http.HttpResponse
"""
return self._serve_401(request, project)
Copy link
Member

Choose a reason for hiding this comment

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

This _serve_401 method doesn't exist on this class. It shouldn't be called if we aren't implementing it.

Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

This looks good to me, but we should make sure to test it against corporate too.

@stale
Copy link

stale bot commented Mar 21, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Mar 21, 2020
@stale stale bot closed this Mar 28, 2020
@stsewd stsewd deleted the humitos/use-doc-permission-mixin branch May 24, 2021 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: stale Issue will be considered inactive soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants