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

Prevent logout GET from getting documented by schema generation #371

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sloria
Copy link
Contributor

@sloria sloria commented Oct 24, 2017

If ACCOUNT_LOGOUT_ON_GET is False, a 405 response is appropriately returned.

However, when using DRF's automatic schema/docs generation, the GET method is still documented.

til api 2017-10-24 19-49-18

Conditionally implementing the get method on the LogoutView will prevent the get endpoint from appearing in the schema/docs.

...by preventing `get` from being implemented if
ACCOUNT_LOGOUT_ON_GET is False
@coveralls
Copy link

coveralls commented Oct 24, 2017

Coverage Status

Coverage decreased (-0.3%) to 96.774% when pulling 76fd218 on sloria:undoc-logout-get into 42d039b on Tivix:master.

@verkaufer
Copy link
Contributor

Thanks for contributing! This looks good to me and we'll get to merging it soon.

@jeanlucmongrain
Copy link

Thanks for contributing! This looks good to me and we'll get to merging it soon.

soon is how many years?

@BarnabasSzabolcs
Copy link

Hi,
as a user of rest-auth, thanks for the contribution!
This repo is not maintained anymore, so the development moved to dj-rest-auth. (reference: #568)
It may be best, if you move this PR there. (and upgrade to using dj_rest_auth)

new repo link: https://github.com/jazzband/dj-rest-auth (I'm not the upkeeper of that repo, it just makes sense for me to help you merge your PR)

Many Thanks,
Barney

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.

None yet

5 participants