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

ValueError: The view admin_multilanguage.views.ChangeLanguageView didn't return an HttpResponse object. It returned None instead. #1

Open
jayvdb opened this issue Jun 23, 2020 · 2 comments

Comments

@jayvdb
Copy link

jayvdb commented Jun 23, 2020

Using django-smoke-tests, this app is breaking on its tests. It doesnt provide the args/params which this app expects, but that is the point - the views should describe what they need, and fail validation sanely and descriptively if not provided.

The smoke tester has an option to exclude apps, so I have excluded this app, so this isnt a high priority. Thanks for the great tool ;-)

======================================================================
ERROR: test_smoke_GET_change_language/ (django_smoke_tests.tests.SmokeTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/django_smoke_tests/generator.py", line 90, in test
    response = http_method_function(url, {})
  File "/usr/lib/python3.8/site-packages/django/test/client.py", line 518, in get
    response = super().get(path, data=data, secure=secure, **extra)
  File "/usr/lib/python3.8/site-packages/django/test/client.py", line 344, in get
    return self.generic('GET', path, secure=secure, **{
  File "/usr/lib/python3.8/site-packages/django/test/client.py", line 421, in generic
    return self.request(**r)
  File "/usr/lib/python3.8/site-packages/django/test/client.py", line 496, in request
    raise exc_value
  File "/usr/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/usr/lib/python3.8/site-packages/django/core/handlers/base.py", line 124, in _get_response
    raise ValueError(
ValueError: The view admin_multilanguage.views.ChangeLanguageView didn't return an HttpResponse object. It returned None instead.
@Vadim-Karpenko
Copy link
Owner

Vadim-Karpenko commented Jun 23, 2020

Hi, jayvdb! Thanks a lot for reporting this issue!
I just uploaded a new update to the dev_stage branch, could you please install it and let me know if the issue is solved?
Here is a pip command to install it directly from the repository - pip install git+https://github.com/Vadim-Karpenko/django-admin-multilang@dev_stage, but make sure that you first deleted the previous version from the pip - pip uninstall django-admin-multilang because pip can think that a module is up-to-date, and there is no need to download it from the repository.

Thanks!
Vadim.

@jayvdb
Copy link
Author

jayvdb commented Jun 24, 2020

Well, it fixes the smoke test problem.

However, I notice it isnt appearing on my local django admin, irrespective of whether I am using that branch or PyPI. I am using Django 3 locally, so that might be it. We use Django 2.2 on production where it is working correctly with the PyPI version.
I am also using django-dbtemplates, so I may need to purge a local cache or something. I'll get back to investigating this soon.

btw, there is also a route set_language which could be usable. Might only be DJ3.
/i18n/setlang/ django.views.i18n.set_language set_language

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