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

Fix authtoken managment command #5415

Merged
merged 2 commits into from Sep 12, 2017
Merged

Fix authtoken managment command #5415

merged 2 commits into from Sep 12, 2017

Conversation

sazarkin
Copy link
Contributor

Problem

Command raised an error when creating token because username param is a list.

Solution

Two options

  • Make username param single argument
  • Iterate trough username params

I choose to go with second.

@sazarkin
Copy link
Contributor Author

I guess I can address it to original contributor of command @andreagrandi

@tomchristie
Copy link
Member

tomchristie commented Sep 12, 2017

I think I'd probably prefer that we remove nargs='+' and make it a single argument.

Presumably the command is outright broken at the moment without that change?

@sazarkin
Copy link
Contributor Author

Nope it does not work (in my env):

$ ➜ python manage.py drf_create_token test@localhost
CommandError: Cannot create the Token: user ['test@localhost'] does not exist

I've updated the PR, removed nargs.

@tomchristie
Copy link
Member

Good stuff. Thanks for this!

@tomchristie tomchristie merged commit 9aaea25 into encode:master Sep 12, 2017
@tomchristie tomchristie added this to the 3.6.5 Release milestone Sep 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants