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

rebuild_index error: "language_code can't be null" #70

Open
leety opened this issue Feb 6, 2017 · 5 comments
Open

rebuild_index error: "language_code can't be null" #70

leety opened this issue Feb 6, 2017 · 5 comments

Comments

@leety
Copy link

leety commented Feb 6, 2017

It seems like this issue is the same as: django-parler/django-parler#90. However, it is still plaguing aldryn-search. I am using the most current version of Parler and have setting the settings.py with default to 'en' , my only solution right now was to set all internationalization settings to False.

It seems @yakky has a solution for his djangoCMS-blog on this commit:
https://github.com/nephila/djangocms-blog/pull/303/commits

I am wondering is it possible to incorporate @yakky's fix into aldryn search?

@czpython
Copy link
Contributor

Hello @leety,
Can you provide me with a full traceback?

I find it odd that parler doesn't respect the thread language when one is explicitly activated.

@pirm-in
Copy link

pirm-in commented Feb 24, 2017

I get this traceback

Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/some/venv/lib/python3.4/site-packages/django/core/management/init.py", line 354, in execute_from_command_line
utility.execute()
File "/some/venv/lib/python3.4/site-packages/django/core/management/init.py", line 346, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/some/venv/lib/python3.4/site-packages/django/core/management/base.py", line 394, in run_from_argv
self.execute(*args, **cmd_options)
File "/some/venv/lib/python3.4/site-packages/django/core/management/base.py", line 445, in execute
output = self.handle(*args, **options)
File "/some/venv/lib/python3.4/site-packages/haystack/management/commands/rebuild_index.py", line 37, in handle
call_command('update_index', **options)
File "/some/venv/lib/python3.4/site-packages/django/core/management/init.py", line 120, in call_command
return command.execute(*args, **defaults)
File "/some/venv/lib/python3.4/site-packages/django/core/management/base.py", line 445, in execute
output = self.handle(*args, **options)
File "/some/venv/lib/python3.4/site-packages/haystack/management/commands/update_index.py", line 214, in handle
self.update_backend(label, using)
File "/some/venv/lib/python3.4/site-packages/haystack/management/commands/update_index.py", line 257, in update_backend
commit=self.commit, max_retries=self.max_retries)
File "/some/venv/lib/python3.4/site-packages/haystack/management/commands/update_index.py", line 84, in do_update
backend.update(index, current_qs, commit=commit)
File "/some/venv/lib/python3.4/site-packages/haystack/backends/solr_backend.py", line 56, in update
docs.append(index.full_prepare(obj))
File "/some/venv/lib/python3.4/site-packages/haystack/indexes.py", line 208, in full_prepare
self.prepared_data = self.prepare(obj)
File "/some/venv/lib/python3.4/site-packages/aldryn_search/base.py", line 42, in prepare
self.prepared_data['text'] = self.get_search_data(obj, current_language, request)
File "/some/venv/lib/python3.4/site-packages/aldryn_people/search_indexes.py", line 34, in get_search_data
return strip_tags(self.get_description(obj)).strip()
File "/some/venv/lib/python3.4/site-packages/aldryn_people/search_indexes.py", line 21, in get_description
return obj.description
File "/some/venv/lib/python3.4/site-packages/parler/fields.py", line 92, in get
translation = instance._get_translated_model(use_fallback=True, meta=meta)
File "/some/venv/lib/python3.4/site-packages/parler/models.py", line 466, in _get_translated_model
raise ValueError(get_null_language_error())
ValueError: language_code can't be null

@Reivax84
Copy link

hello,
any news on this topic?
Xavier

@tehfink
Copy link

tehfink commented Sep 12, 2018

Any update on this?

@tehfink
Copy link

tehfink commented Oct 9, 2018

Hi guys, after poking around in the code, I found that apparently this a known issue (but only mentioned in the docs of a different project…for some reason):
https://github.com/aldryn/aldryn-haystack#usage-with-aldryn-search
Setting ALDRYN_PEOPLE_SEARCH to False obviates the ValueError: language_code can't be null issue.

Perhaps the docs for aldryn-search could be updated to note that aldryn-people is not supported?

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

5 participants