WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.63k stars 1.02k forks source link

Error while trying to change component VCS: 'ComponentSettingsForm' has no field named 'git_export' #3473

Closed Johnson145 closed 4 years ago

Johnson145 commented 4 years ago

Describe the bug I've set up one project with multiple components. All of them are configured to use the same external git repository. Now I'm trying to change this configuration such that only one component is actually configured to use the external repository, while all other components should point to the former components repository by using a n URL like weblate://projectname/componentname.

However, I can't change the configuration of any of those existing components. When trying to save (after entering the weblate://projectname/componentname url), I always get the following error: 'ComponentSettingsForm' has no field named 'git_export'

To Reproduce See above.

Expected behavior Changes should be saved, the existing component should get rid of its own repository clone and use the version of the referenced component instead.

Server configuration and status

_listversions

 * Weblate: 3.10.3
 * Django: 3.0.2
 * siphashc: 1.3
 * Whoosh: 2.7.4
 * translate-toolkit: 2.5.0
 * lxml: 4.3.2
 * Pillow: 7.0.0
 * bleach: 3.1.0
 * six: 1.14.0
 * python-dateutil: 2.8.1
 * social-auth-core: 3.2.0
 * social-auth-app-django: 3.1.0
 * django-crispy-forms: 1.8.1
 * oauthlib: 3.1.0
 * django-compressor: 2.4
 * djangorestframework: 3.11.0
 * django-appconf: 1.0.3
 * user-agents: 2.0
 * filelock: 3.0.12
 * setuptools: 40.8.0
 * jellyfish: 0.7.2
 * openpyxl: 3.0.1
 * celery: 4.4.0
 * kombu: 4.6.7
 * celery-batches: 0.2
 * translation-finder: 1.7
 * html2text: 2020.1.16
 * pycairo: 1.16.2
 * pygobject: 3.30.4
 * diff-match-patch: 20181111
 * requests: 2.22.0
 * django-redis: 4.11.0
 * hiredis: 1.0.1
 * sentry_sdk: 0.14.0
 * Cython: 0.29.14
 * misaka: 2.1.1
 * GitPython: 3.0.5
 * borgbackup: 1.1.10
 * Python: 3.7.3
 * Git: 2.20.1
 * psycopg2: 2.7.7
 * phply: 1.2.5
 * chardet: 3.0.4
 * ruamel.yaml: 0.16.5
 * tesserocr: 2.5.0
 * akismet: 1.0.1
 * boto3: 1.11.5
 * zeep: 3.4.0
 * aeidon: 1.6.0
 * Mercurial: 4.8.2
 * git-svn: 2.20.1
 * Database backends: django.db.backends.postgresql
 * Cache backends: default:RedisCache, avatar:FileBasedCache
 * Email setup: django.core.mail.backends.smtp.EmailBackend: mail.xy.com
 * Celery: redis://cache:6379/1, redis://cache:6379/1, regular
 * Platform: Linux 4.15.0-1058-aws (x86_64)

check --deploy

WARNINGS:
?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire site is served only over SSL, you may want to consider setting a value and enabling HTTP Strict Transport Security. Be sure to read the documentation first; enabling HSTS carelessly can cause serious, irreversible problems.

INFOS:
?: (weblate.I021) Error collection is not configured, it is highly recommended for production use
    HINT: https://docs.weblate.org/en/weblate-3.10.3/admin/install.html#collecting-errors
?: (weblate.I028) Backups are not configured, it is highly recommended for production use
    HINT: https://docs.weblate.org/en/weblate-3.10.3/admin/backup.html

System check identified 3 issues (1 silenced).

Additional context I've already updated to the latest weblate version without success.

traceback (received by mail)

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/django/forms/models.py", line 404, in _post_clean
    self.instance.full_clean(exclude=exclude, validate_unique=False)
  File "/usr/local/lib/python3.7/dist-packages/django/db/models/base.py", line 1222, in full_clean
    raise ValidationError(errors)

During handling of the above exception ({'git_export': ['Die Option ist für verknüpfte Repositories nicht verfügbar.']}), another exception occurred:
  File "/usr/local/lib/python3.7/dist-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.7/dist-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.7/dist-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.7/dist-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/weblate/trans/views/settings.py", line 79, in change_component
    if form.is_valid():
  File "/usr/local/lib/python3.7/dist-packages/django/forms/forms.py", line 180, in is_valid
    return self.is_bound and not self.errors
  File "/usr/local/lib/python3.7/dist-packages/django/forms/forms.py", line 175, in errors
    self.full_clean()
  File "/usr/local/lib/python3.7/dist-packages/django/forms/forms.py", line 378, in full_clean
    self._post_clean()
  File "/usr/local/lib/python3.7/dist-packages/django/forms/models.py", line 406, in _post_clean
    self._update_errors(e)
  File "/usr/local/lib/python3.7/dist-packages/django/forms/models.py", line 380, in _update_errors
    self.add_error(None, errors)
  File "/usr/local/lib/python3.7/dist-packages/django/forms/forms.py", line 348, in add_error
    "'%s' has no field named '%s'." % (self.__class__.__name__, field))

Exception Type: ValueError at /settings/project/component/
Exception Value: 'ComponentSettingsForm' has no field named 'git_export'.

Any help is appreciated very much!

github-actions[bot] commented 4 years ago

Thank you for your report, the issue you have reported has just been fixed.

Johnson145 commented 4 years ago

Thanks for your help!

I've just updated weblate to 3.11.2, but I'm still getting the same error. Am I missing something?

nijel commented 4 years ago

You're right, I've fixed something slightly different. It should be addressed by 9c252011e0f260b1648ee3e74294428740d4c9f6 to be released in 3.11.3.