I saw something in the release notes about a new --database flag to the
check command, but I cannot piece together if it has anything to do with
this error (Running manage.py check with '--database default' does not
remove the crash, for instance).
{{{
.venv/bin/python manage.py check
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "app/.venv/lib/python3.8/site-
packages/django/core/management/__init__.py", line 401, in
execute_from_command_line
utility.execute()
File "app/.venv/lib/python3.8/site-
packages/django/core/management/__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "app/.venv/lib/python3.8/site-
packages/django/core/management/base.py", line 330, in run_from_argv
self.execute(*args, **cmd_options)
File "app/.venv/lib/python3.8/site-
packages/django/core/management/base.py", line 371, in execute
output = self.handle(*args, **options)
File "app/.venv/lib/python3.8/site-
packages/django/core/management/commands/check.py", line 63, in handle
self.check(
File "app/.venv/lib/python3.8/site-
packages/django/core/management/base.py", line 392, in check
all_issues = checks.run_checks(
File "app/.venv/lib/python3.8/site-
packages/django/core/checks/registry.py", line 70, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "app/.venv/lib/python3.8/site-
packages/django/core/checks/model_checks.py", line 34, in check_all_models
errors.extend(model.check(**kwargs))
File "app/.venv/lib/python3.8/site-packages/django/db/models/base.py",
line 1264, in check
*cls._check_fields(**kwargs),
File "app/.venv/lib/python3.8/site-packages/django/db/models/base.py",
line 1343, in _check_fields
errors.extend(field.check(**kwargs))
TypeError: check() got an unexpected keyword argument 'databases'
}}}
(I stripped out some of the absolute paths to file names that should be
irrelevant from the traceback)
--
Ticket URL: <https://code.djangoproject.com/ticket/32017>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => needsinfo
Comment:
Thanks for this ticket however I cannot reproduce this issue. Can you
provide a small project?
--
Ticket URL: <https://code.djangoproject.com/ticket/32017#comment:1>
Comment (by Stian Jensen):
Hi, after trying to make a reproduce I finally tracked down the issue in
our codebase. We have a custom model field where we've overridden the
`check` method to do some extra validation of the field config. That
method wasn't setup to take in `**kwargs`. It seems like something has
changed in django 3.1 that now sends `databases` as a kwarg, so just
changing our method signature to `check(self, **kwargs):` solved the
problem.
Thanks, and sorry for the incorrect bug report!
--
Ticket URL: <https://code.djangoproject.com/ticket/32017#comment:2>
* resolution: needsinfo => invalid
Comment:
Thanks for checking.
--
Ticket URL: <https://code.djangoproject.com/ticket/32017#comment:3>