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

from_db_value() missing 1 required positional argument: 'context' #447

Closed
diegoduncan21 opened this issue Mar 22, 2021 · 3 comments
Closed

Comments

@diegoduncan21
Copy link

diegoduncan21 commented Mar 22, 2021

Describe the problem

Im using DB backend(mysql:5.7.22).

I see this error in the django admin in the constance section.

TypeError at /admin/constance/config/
from_db_value() missing 1 required positional argument: 'context'

Steps to reproduce

First I see all the constants in the admin with the default values setted, I see in the DB and there is no data in the constance_config table. Until here is all normal I think that is the default behavior.

Second I press save without modify any constant and all the constants are saved in the DB, after this action I can't see the admin again and this error is raised:

TypeError at /admin/constance/config/
from_db_value() missing 1 required positional argument: 'context'

System configuration

  • Django version: 3.1.4
  • Python version: 3.8
  • Django-Constance version: 2.8.0
@blw0rm
Copy link

blw0rm commented Mar 29, 2021

Confirming the same issue for DB backend with PostgreSQL 13.2.

@blw0rm
Copy link

blw0rm commented Mar 30, 2021

Actually, the problem only appears with django-picklefield versions prior to 2.0 after which the "context" argument was removed from the from_db_value field method. This ensures compatibility with Django 2.0 and upper versions.
So the solution is to upgrade django-picklefield 2.0 and higher.

@diegoduncan21
Copy link
Author

Actually, the problem only appears with django-picklefield versions prior to 2.0 after which the "context" argument was removed from the from_db_value field method. This ensures compatibility with Django 2.0 and upper versions.
So the solution is to upgrade django-picklefield 2.0 and higher.

totally, I upgrade django-picklefield to the last version and it works! thanks!

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

No branches or pull requests

2 participants