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 deprecations in management commands #4321

Merged
merged 1 commit into from Jul 3, 2018

Conversation

Projects
None yet
3 participants
@stsewd
Member

stsewd commented Jul 2, 2018

Adding arguments via option_list was deprecated in django 1.8 and it is removed en django 1.10

https://docs.djangoproject.com/en/1.9/howto/custom-management-commands/#django.core.management.BaseCommand.option_list

Raised in #4319 (comment)

@stsewd stsewd requested a review from rtfd/core Jul 2, 2018

@humitos

humitos approved these changes Jul 3, 2018

Good!

@ericholscher ericholscher merged commit d413341 into rtfd:master Jul 3, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@stsewd stsewd deleted the stsewd:fix-deprecations-management-commands branch Jul 3, 2018

@@ -26,22 +26,30 @@ class Command(BaseCommand):
"""Management command for rebuilding documentation on projects"""
help = __doc__
option_list = BaseCommand.option_list + (

This comment has been minimized.

@humitos

humitos Jul 6, 2018

Member

It seems that we lose the positional arguments:

manage.py update_repos mkdocs

doesn't work anymore.

This command is used when import_from_live is called.

From the example at https://docs.djangoproject.com/en/1.9/howto/custom-management-commands/#custom-commands-options we need some extra lines to allow that.

I had to add this to make it work.

        parser.add_argument('slugs', nargs='+', type=str)

Probably similar work is needed in the rest of the commands.

cc @stsewd

This comment has been minimized.

@stsewd

stsewd Jul 6, 2018

Member

I'll see if I can fix this today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment