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

Merged

Conversation

stsewd
Copy link
Member

@stsewd 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 a team July 2, 2018 23:19
Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

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

Good!

@ericholscher ericholscher merged commit d413341 into readthedocs:master Jul 3, 2018
@stsewd stsewd deleted the fix-deprecations-management-commands branch July 3, 2018 14:22
@@ -26,22 +26,30 @@ class Command(BaseCommand):
"""Management command for rebuilding documentation on projects"""

help = __doc__
option_list = BaseCommand.option_list + (
Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
Member Author

Choose a reason for hiding this comment

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

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants