django-cms: [BUG] management command "cms check" doesn't work

Description

When running the command python manage.py cms check on the develop branch there is an issue with the argument parsing of the custom management command.

I am aware that this happens on a development branch. This issue is mainly to raise awareness and coordinate any efforts to fix this issue.

Steps to reproduce

Run the command python manage.py cms check and the following output is logged:

Traceback (most recent call last): File “/home/michael/projects/django-cms-demo/myproject/manage.py”, line 22, in <module> main() File “/home/michael/projects/django-cms-demo/myproject/manage.py”, line 18, in main execute_from_command_line(sys.argv) File “/home/michael/projects/django-cms-demo/venv/lib/python3.9/site-packages/django/core/management/init.py”, line 419, in execute_from_command_line utility.execute() File “/home/michael/projects/django-cms-demo/venv/lib/python3.9/site-packages/django/core/management/init.py”, line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File “/home/michael/projects/django-cms-demo/venv/lib/python3.9/site-packages/django/core/management/base.py”, line 355, in run_from_argv self.execute(*args, **cmd_options) File “/home/michael/projects/django-cms-demo/venv/lib/python3.9/site-packages/django/core/management/base.py”, line 391, in execute if self.requires_system_checks and not options[‘skip_checks’]: KeyError: ‘skip_checks’

Expected behaviour

CMS checks are performed without error.

Actual behaviour

The parsing of the management command fails with an error on parsing the arguments passed to the management command.

Additional information (CMS/Python/Django versions)

Regular management commands (for example manage.py check) work without issue.

  • Django CMS: develop branch
  • Python 3.9
  • Installed packages:

asgiref==3.3.4 Django==3.2.2 django-classy-tags==1.0.0 django-cms @ file:///home/michael/projects/django-cms django-formtools==2.2 django-sekizai==2.0.0 django-treebeard==4.3.1 djangocms-admin-style==2.0.2 pytz==2021.1 six==1.16.0 sqlparse==0.4.1

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 18 (16 by maintainers)

Commits related to this issue

Most upvoted comments

@goutnet here is the bug:

https://github.com/django-cms/django-cms/blob/develop/cms/management/commands/subcommands/base.py#L40

If you also import DJANGO_3_2 here and then include or DJANGO_3_2 in the test here, the problem is fixed.

EDIT: I’ll prepare a PR. EDIT2: quick and dirty 😁 https://github.com/django-cms/django-cms/pull/7054