stephenmcd / mezzanine

CMS framework for Django

Home Page:http://mezzanine.jupo.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error : from_db_value() missing 1 required positional argument: 'context'

pysecuser opened this issue Β· comments

commented

### Steps to reproduce the problem:

Install latest version from github.
python setup.py build
python setup.py install

Create a project and manage.py createdb
The createdb will throw error regarding 'six' which is coming from filebrowser_safe. If you get the latest code and build your self, that error will be gone.

Run the server and try to browse localhost:8000

This will throw following error:

TypeError at /
from_db_value() missing 1 required positional argument: 'context'
Exception Location:
python3.8/site-packages/Django-3.1.1-py3.8.egg/django/db/models/sql/compiler.py, line 1100, in apply_converters

Error during template rendering
In template lib/python3.8/site-packages/Mezzanine-0.0.dev0-py3.8.egg/mezzanine/core/templates/base.html, error at line 67
{% block navbar_dropdown_menu %}{% page_menu "pages/menus/dropdown.html" %}{% endblock%}

Hello!

So this is only an issue when using filebrowser_safe from PyPI? If that's the case then that's the expected behavior: development versions of Mezzanine should be used with development versions of grappelli_safe and filebrowser_safe

commented

Thanks for the response. Unfortunately no! This issue is not related to filebrowser_safe. The filebrowser_safe shipped with development version has 'six' issue. That can be fixed by using development version of filebrowser_safe.

The error from_db_value() missing 1 required... is still there even if you move past filebrowser_safe's 'six' issue.

Note this error is also triggered when MultiChoiceField is used.

In mezzanine/core/fields.py:

def from_db_value(self, value, expression, connection, context):

The context arg needs to be removed.

πŸŽ‰ This issue has been resolved in version 5.0.0-rc.1 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

πŸŽ‰ This issue has been resolved in version 5.0.0 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€