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: 'Project' object has no attribute 'source_language' When adding a new translation component #5508

Closed
cedricbonhomme opened this issue Feb 23, 2021 · 2 comments
Assignees
Labels
bug Something is broken.
Milestone

Comments

@cedricbonhomme
Copy link

Describe the issue

When adding a new translation component I get:

AttributeError at /reset/monarc/monarc-front-office/

'Project' object has no attribute 'source_language'

The component is added via version control.

The error is in (as you can see in the screen shot) below:

Exception Location: | /home/cases/weblate-src/weblate/trans/models/project.py, line 251, in get_language_alias

I tried to change this line. If I return for example directly the string 'en', there is no issue. It seems to work. The component is added.

Commenting

I just installed Weblate, for the first time (by the way it is very cool !).
Installed from source on master, no issues.
I tried to checkout to the last release tag. It does not hep.

It is using Python 3.8.8. on an Ubuntu 20.04 LTS.

Describe the steps you tried to solve the problem yourself.

To Reproduce the issue

  • create a new project;
  • Add a translation component to this project ("From version control");
  • specify the repository (https://github.com/monarc-project/ng-client);
  • it automatically finds po files (po/);
  • I specify the licenses of the translation, the default po file;
  • click save

Screenshots

capture

Server configuration and status

Ubuntu 20.04 LTS
Python 3.8.8 installed with pyenv
Using Apach (mod_wsgi)

On pip installed Weblate:

$ weblate list_versions
 * Weblate: weblate-4.5-73-gac4dd72fa6
 * Django: 3.1.7
 * siphashc: 2.1
 * translate-toolkit: 3.3.2
 * lxml: 4.6.2
 * Pillow: 8.1.0
 * bleach: 3.3.0
 * python-dateutil: 2.8.1
 * social-auth-core: 4.0.3
 * social-auth-app-django: 4.0.0
 * django-crispy-forms: 1.11.1
 * oauthlib: 3.1.0
 * django-compressor: 2.4
 * djangorestframework: 3.12.2
 * django-filter: 2.4.0
 * django-appconf: 1.0.4
 * user-agents: 2.2.0
 * filelock: 3.0.12
 * setuptools: 44.0.0
 * jellyfish: 0.8.2
 * openpyxl: 3.0.6
 * celery: 5.0.5
 * kombu: 5.0.2
 * translation-finder: 2.9
 * weblate-language-data: 2021.2
 * html2text: 2020.1.16
 * pycairo: 1.20.0
 * pygobject: 3.38.0
 * diff-match-patch: 20200713
 * requests: 2.22.0
 * django-redis: 4.12.1
 * hiredis: 1.1.0
 * sentry_sdk: 0.20.3
 * Cython: 0.29.22
 * misaka: 2.1.1
 * GitPython: 3.1.13
 * borgbackup: 1.1.15
 * pyparsing: 2.4.6
 * Python: 3.8.5
 * Git: 2.25.1
 * psycopg2-binary: 2.8.6
 * chardet: 3.0.4
 * ruamel.yaml: 0.16.12
 * Redis server: 5.0.7
 * PostgreSQL server: 10.15
 * Database backends: django.db.backends.postgresql
 * Cache backends: default:RedisCache, avatar:FileBasedCache
 * Email setup: django.core.mail.backends.smtp.EmailBackend: localhost
 * OS encoding: filesystem=utf-8, default=utf-8
 * Celery: redis://localhost:6379, redis://localhost:6379, regular
 * Platform: Linux 5.4.0-65-generic (x86_64)

Weblate deploy checks

On pip installed Weblate:

$ weblate check --deploy
System check identified some issues:

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.
?: (security.W008) Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site should be available over both SSL and non-SSL connections, you may want to either set this setting True or configure a load balancer or reverse-proxy server to redirect all connections to HTTPS.
?: (security.W012) SESSION_COOKIE_SECURE is not set to True. Using a secure-only session cookie makes it more difficult for network traffic sniffers to hijack user sessions.
?: (security.W018) You should not have DEBUG set to True in deployment.
?: (weblate.W025.ass) Failure in loading handler for ass file format: aeidon or gaupol package required for Subtitle support
        HINT: https://docs.weblate.org/en/weblate-4.5/admin/install.html#optional-deps
?: (weblate.W025.ini) Failure in loading handler for ini file format: Missing iniparse library.
        HINT: https://docs.weblate.org/en/weblate-4.5/admin/install.html#optional-deps
?: (weblate.W025.islu) Failure in loading handler for islu file format: Missing iniparse library.
        HINT: https://docs.weblate.org/en/weblate-4.5/admin/install.html#optional-deps
?: (weblate.W025.laravel) Failure in loading handler for laravel file format: No module named 'phply'
        HINT: https://docs.weblate.org/en/weblate-4.5/admin/install.html#optional-deps
?: (weblate.W025.php) Failure in loading handler for php file format: No module named 'phply'
        HINT: https://docs.weblate.org/en/weblate-4.5/admin/install.html#optional-deps
?: (weblate.W025.srt) Failure in loading handler for srt file format: aeidon or gaupol package required for Subtitle support
        HINT: https://docs.weblate.org/en/weblate-4.5/admin/install.html#optional-deps
?: (weblate.W025.ssa) Failure in loading handler for ssa file format: aeidon or gaupol package required for Subtitle support
        HINT: https://docs.weblate.org/en/weblate-4.5/admin/install.html#optional-deps
?: (weblate.W025.sub) Failure in loading handler for sub file format: aeidon or gaupol package required for Subtitle support
        HINT: https://docs.weblate.org/en/weblate-4.5/admin/install.html#optional-deps
?: (weblate.W033.Gerrit) Failure in loading VCS module for Gerrit: git: 'review' is not a git command. See 'git --help'.
 (1)
        HINT: https://docs.weblate.org/en/weblate-4.5/vcs.html
?: (weblate.W033.Mercurial) Failure in loading VCS module for Mercurial: [Errno 2] No such file or directory: 'hg'
        HINT: https://docs.weblate.org/en/weblate-4.5/vcs.html
?: (weblate.W033.Subversion) Failure in loading VCS module for Subversion: git: 'svn' is not a git command. See 'git --help'.

The most similar commands are
        fsck
        mv
        show
 (1)
        HINT: https://docs.weblate.org/en/weblate-4.5/vcs.html

INFOS:
?: (weblate.I021) Error collection is not set up, it is highly recommended for production use
        HINT: https://docs.weblate.org/en/weblate-4.5/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-4.5/admin/backup.html

System check identified 17 issues (1 silenced).
@nijel nijel self-assigned this Feb 23, 2021
@nijel nijel added the bug Something is broken. label Feb 23, 2021
@nijel nijel added this to the 4.5.1 milestone Feb 23, 2021
@nijel nijel closed this as completed in f558c5c Feb 23, 2021
@github-actions
Copy link

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

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

@cedricbonhomme
Copy link
Author

cedricbonhomme commented Feb 23, 2021

thanks, that was fast !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken.
Projects
None yet
Development

No branches or pull requests

2 participants