2.1b1: Getting "unexpected keyword argument 'limit_choices_to'"

111 views
Skip to first unread message

Axel Rau

unread,
Jul 4, 2018, 7:46:54 AM7/4/18
to django...@googlegroups.com
Hi,

I tried 2.1b1 with my 2.0.6 project and at got this error on startup:
—-
(erdb_d2.1+p3.6) axels-imac:ERDB2 ajr$ django-admin check
/usr/local/py_env/erdb_d2.1+p3.6/lib/python3.6/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
""")
Traceback (most recent call last):
File "/usr/local/py_env/erdb_d2.1+p3.6/bin/django-admin", line 11, in <module>
sys.exit(execute_from_command_line())
File "/usr/local/py_env/erdb_d2.1+p3.6/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/usr/local/py_env/erdb_d2.1+p3.6/lib/python3.6/site-packages/django/core/management/__init__.py", line 357, in execute
django.setup()
File "/usr/local/py_env/erdb_d2.1+p3.6/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/py_env/erdb_d2.1+p3.6/lib/python3.6/site-packages/django/apps/registry.py", line 120, in populate
app_config.ready()
File "/usr/local/py_env/erdb_d2.1+p3.6/lib/python3.6/site-packages/django/contrib/admin/apps.py", line 24, in ready
self.module.autodiscover()
File "/usr/local/py_env/erdb_d2.1+p3.6/lib/python3.6/site-packages/django/contrib/admin/__init__.py", line 26, in autodiscover
autodiscover_modules('admin', register_to=site)
File "/usr/local/py_env/erdb_d2.1+p3.6/lib/python3.6/site-packages/django/utils/module_loading.py", line 47, in autodiscover_modules
import_module('%s.%s' % (app_config.name, module_to_search))
File "/usr/local/py_env/erdb_d2.1+p3.6/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/local/py_env/erdb_d2.1+p3.6/lib/python3.6/site-packages/django/contrib/auth/admin.py", line 6, in <module>
from django.contrib.auth.forms import (
File "/usr/local/py_env/erdb_d2.1+p3.6/lib/python3.6/site-packages/django/contrib/auth/forms.py", line 63, in <module>
class UserCreationForm(forms.ModelForm):
File "/usr/local/py_env/erdb_d2.1+p3.6/lib/python3.6/site-packages/django/forms/models.py", line 256, in __new__
apply_limit_choices_to=False,
File "/usr/local/py_env/erdb_d2.1+p3.6/lib/python3.6/site-packages/django/forms/models.py", line 172, in fields_for_model
formfield = f.formfield(**kwargs)
File "/usr/local/py_env/erdb_d2.1+p3.6/lib/python3.6/site-packages/django/db/models/fields/related.py", line 1016, in formfield
return super().formfield(**kwargs)
File "/usr/local/py_env/erdb_d2.1+p3.6/lib/python3.6/site-packages/django/db/models/fields/related.py", line 956, in formfield
**kwargs,
File "/usr/local/py_env/erdb_d2.1+p3.6/lib/python3.6/site-packages/django/db/models/fields/related.py", line 418, in formfield
return super().formfield(**defaults)
File "/usr/local/py_env/erdb_d2.1+p3.6/lib/python3.6/site-packages/django/db/models/fields/__init__.py", line 890, in formfield
return form_class(**defaults)
File "/usr/local/py_env/erdb_d2.1+p3.6/lib/python3.6/site-packages/django/forms/fields.py", line 213, in __init__
super().__init__(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'limit_choices_to'
(erdb_d2.1+p3.6) axels-imac:ERDB2 ajr$ findp imit_choices_to
- - -
Seems to happen somewhere in Django code.

Any help appreciated,
Axel
---
PGP-Key:29E99DD6 ☀ computing @ chaos claudius

Jason

unread,
Jul 4, 2018, 10:02:23 AM7/4/18
to Django users
You might want to add that to the developers mailing list at https://groups.google.com/forum/#!forum/django-developers or make a bug report on the django issue tracker.  

If its working in 2.0, then there's a regression happening.

Markus Holtermann

unread,
Jul 4, 2018, 11:11:05 AM7/4/18
to Django users
Thanks for the report Axel. This seems to be the same issue as the one reported in https://code.djangoproject.com/ticket/29449 . A fix for this is coming with the next pre release (beta 2 or RC1).

/Markus

Axel Rau

unread,
Jul 5, 2018, 5:36:21 AM7/5/18
to django...@googlegroups.com
Thanks Markus for the hint.
f3fa86a fixed the problem.

Am 04.07.2018 um 17:11 schrieb Markus Holtermann <in...@markusholtermann.eu>:

Thanks for the report Axel. This seems to be the same issue as the one reported in https://code.djangoproject.com/ticket/29449 . A fix for this is coming with the next pre release (beta 2 or RC1).

Reply all
Reply to author
Forward
0 new messages