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 Jul 2, 2018
humitos
humitos approved these changes Jul 3, 2018
Copy link
Member

@humitos humitos left a comment

Good!

Loading

@ericholscher ericholscher merged commit d413341 into readthedocs:master Jul 3, 2018
1 check passed
Loading
@stsewd stsewd deleted the 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 + (
Copy link
Member

@humitos humitos Jul 6, 2018

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

Loading

Copy link
Member Author

@stsewd stsewd Jul 6, 2018

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

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants