stephenmcd / mezzanine

CMS framework for Django
http://mezzanine.jupo.org
BSD 2-Clause "Simplified" License
4.76k stars 1.65k forks source link

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

Closed pysecuser closed 3 years ago

pysecuser commented 3 years ago

### 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%}

jerivas commented 3 years ago

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

pysecuser commented 3 years ago

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.

rantecki commented 3 years ago

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.

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 5.0.0-rc.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 5.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: