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

AttributeError during DeepL translation #2134

Closed
Tracked by #1928
timobrembeck opened this issue Mar 22, 2023 · 0 comments · Fixed by #2135
Closed
Tracked by #1928

AttributeError during DeepL translation #2134

timobrembeck opened this issue Mar 22, 2023 · 0 comments · Fixed by #2135
Assignees
Labels
🐛 bug Something isn't working ☺️ effort: low Should be doable in <4h 🆘 prio: urgent Needs to be resolved now(?)
Milestone

Comments

@timobrembeck
Copy link
Member

Describe the Bug

The changes introduced in #2124 broke the existing DeepL features

Steps to Reproduce

  1. Go to page form and save
  2. Or go to event/location list and use automatic translation feature
  3. See error

Expected Behavior

The translations should be updated automatically

Actual Behavior

An AttributeError appears

Additional Information

Traceback (page form)
Traceback (most recent call last):
File "/home/timo/job/integreat/integreat-cms/.venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 47, in inner
  response = get_response(request)
File "/home/timo/job/integreat/integreat-cms/.venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 181, in _get_response
  response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/timo/job/integreat/integreat-cms/.venv/lib/python3.10/site-packages/django/views/generic/base.py", line 70, in view
  return self.dispatch(request, *args, **kwargs)
File "/home/timo/job/integreat/integreat-cms/.venv/lib/python3.10/site-packages/django/utils/decorators.py", line 43, in _wrapper
  return bound_method(*args, **kwargs)
File "/home/timo/job/integreat/integreat-cms/.venv/lib/python3.10/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
  return view_func(request, *args, **kwargs)
File "/home/timo/job/integreat/integreat-cms/.venv/lib/python3.10/site-packages/django/views/generic/base.py", line 98, in dispatch
  return handler(request, *args, **kwargs)
File "/usr/lib/python3.10/contextlib.py", line 79, in inner
  return func(*args, **kwds)
File "/home/timo/job/integreat/integreat-cms/integreat_cms/cms/views/pages/page_form_view.py", line 352, in post
  and machine_translation_form.is_valid()
File "/home/timo/job/integreat/integreat-cms/.venv/lib/python3.10/site-packages/django/forms/forms.py", line 175, in is_valid
  return self.is_bound and not self.errors
File "/home/timo/job/integreat/integreat-cms/.venv/lib/python3.10/site-packages/django/forms/forms.py", line 170, in errors
  self.full_clean()
File "/home/timo/job/integreat/integreat-cms/.venv/lib/python3.10/site-packages/django/forms/forms.py", line 372, in full_clean
  self._clean_fields()
File "/home/timo/job/integreat/integreat-cms/.venv/lib/python3.10/site-packages/django/forms/forms.py", line 390, in _clean_fields
  value = field.clean(value)
File "/home/timo/job/integreat/integreat-cms/.venv/lib/python3.10/site-packages/django/forms/models.py", line 1334, in clean
  return self.queryset.none()

Exception Type: AttributeError at /augsburg/pages/de/1/edit/
Exception Value: 'NoneType' object has no attribute 'none'
Traceback (event/location list)
Traceback (most recent call last):
File "/home/timo/job/integreat/integreat-cms/.venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 47, in inner
  response = get_response(request)
File "/home/timo/job/integreat/integreat-cms/.venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 181, in _get_response
  response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/timo/job/integreat/integreat-cms/.venv/lib/python3.10/site-packages/django/views/generic/base.py", line 70, in view
  return self.dispatch(request, *args, **kwargs)
File "/home/timo/job/integreat/integreat-cms/.venv/lib/python3.10/site-packages/django/contrib/auth/mixins.py", line 104, in dispatch
  return super().dispatch(request, *args, **kwargs)
File "/home/timo/job/integreat/integreat-cms/.venv/lib/python3.10/site-packages/django/views/generic/base.py", line 98, in dispatch
  return handler(request, *args, **kwargs)
File "/home/timo/job/integreat/integreat-cms/integreat_cms/cms/views/bulk_action_views.py", line 133, in post
  if deepl.check_availability(request, kwargs.get("language_slug")):
File "/home/timo/job/integreat/integreat-cms/integreat_cms/deepl_api/utils.py", line 44, in check_availability
  source_language = request.region.get_source_language(target_language.slug)
@timobrembeck timobrembeck added 🐛 bug Something isn't working ☺️ effort: low Should be doable in <4h 🆘 prio: urgent Needs to be resolved now(?) labels Mar 22, 2023
@timobrembeck timobrembeck added this to the 23Q1 milestone Mar 22, 2023
@timobrembeck timobrembeck self-assigned this Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working ☺️ effort: low Should be doable in <4h 🆘 prio: urgent Needs to be resolved now(?)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant