Skip to content

Commit

Permalink
Component: Drop committer name and e-mail setting
Browse files Browse the repository at this point in the history
These were never user-editable and there is probably no good reason
to make this overridable on component level.
  • Loading branch information
nijel committed Mar 12, 2021
1 parent 64b2e3a commit 2150087
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 42 deletions.
12 changes: 4 additions & 8 deletions docs/admin/config.rst
Expand Up @@ -528,13 +528,11 @@ DEFAULT_COMMITER_EMAIL

.. versionadded:: 2.4

Committer e-mail address for created translation components defaulting to ``noreply@weblate.org``.
Committer e-mail address defaulting to ``noreply@weblate.org``.

.. seealso::

:setting:`DEFAULT_COMMITER_NAME`,
:ref:`component`,
:ref:`component-committer_email`
:setting:`DEFAULT_COMMITER_NAME`

.. setting:: DEFAULT_COMMITER_NAME

Expand All @@ -543,13 +541,11 @@ DEFAULT_COMMITER_NAME

.. versionadded:: 2.4

Committer name for created translation components defaulting to ``Weblate``.
Committer name defaulting to ``Weblate``.

.. seealso::

:setting:`DEFAULT_COMMITER_EMAIL`,
:ref:`component`,
:ref:`component-committer_name`
:setting:`DEFAULT_COMMITER_EMAIL`

.. setting:: DEFAULT_LANGUAGE

Expand Down
19 changes: 0 additions & 19 deletions docs/admin/projects.rst
Expand Up @@ -643,25 +643,6 @@ Default value can be changed by :setting:`DEFAULT_ADD_MESSAGE`,
:setting:`DEFAULT_ADDON_MESSAGE`, :setting:`DEFAULT_COMMIT_MESSAGE`,
:setting:`DEFAULT_DELETE_MESSAGE`, :setting:`DEFAULT_MERGE_MESSAGE`.

.. _component-committer_name:

Committer name
++++++++++++++

Name of the committer used for Weblate commits, the author will always be the
real translator. On some VCSs this might be not supported.

Default value can be changed by :setting:`DEFAULT_COMMITER_NAME`.

.. _component-committer_email:

Committer e-mail
++++++++++++++++

Email of committer used for Weblate commits, the author will always be the
real translator. On some VCSs this might be not supported. The default value
can be changed in :setting:`DEFAULT_COMMITER_EMAIL`.

.. _component-push_on_commit:

Push on commit
Expand Down
2 changes: 0 additions & 2 deletions weblate/trans/discovery.py
Expand Up @@ -53,8 +53,6 @@
"delete_message",
"merge_message",
"addon_message",
"committer_name",
"committer_email",
"push_on_commit",
"commit_pending_age",
"edit_template",
Expand Down
2 changes: 0 additions & 2 deletions weblate/trans/fixtures/simple-project.json
Expand Up @@ -587,8 +587,6 @@
"commit_message": "Translated using Weblate (%(language_name)s)\n\nCurrently translated at %(translated_percent)s%% (%(translated)s of %(total)s strings)\n\nTranslation: %(project)s/%(component)s\nTranslate-URL: %(url)s",
"add_message": "Added translation using Weblate (%(language_name)s)\n\n",
"delete_message": "Deleted translation using Weblate (%(language_name)s)\n\n",
"committer_name": "Weblate",
"committer_email": "noreply@weblate.org",
"language_regex": "^[^.]+$",
"priority": 100
}
Expand Down
21 changes: 21 additions & 0 deletions weblate/trans/migrations/0126_auto_20210312_1348.py
@@ -0,0 +1,21 @@
# Generated by Django 3.1.7 on 2021-03-12 13:48

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("trans", "0125_unit_details"),
]

operations = [
migrations.RemoveField(
model_name="component",
name="committer_email",
),
migrations.RemoveField(
model_name="component",
name="committer_name",
),
]
14 changes: 3 additions & 11 deletions weblate/trans/models/component.py
Expand Up @@ -548,16 +548,6 @@ class Component(FastDeleteModelMixin, models.Model, URLMixin, PathMixin, CacheKe
validators=[validate_render_addon],
default=settings.DEFAULT_ADDON_MESSAGE,
)
committer_name = models.CharField(
verbose_name=gettext_lazy("Committer name"),
max_length=200,
default=settings.DEFAULT_COMMITER_NAME,
)
committer_email = models.EmailField(
verbose_name=gettext_lazy("Committer e-mail"),
max_length=254,
default=settings.DEFAULT_COMMITER_EMAIL,
)
push_on_commit = models.BooleanField(
verbose_name=gettext_lazy("Push on commit"),
default=settings.DEFAULT_PUSH_ON_COMMIT,
Expand Down Expand Up @@ -1298,7 +1288,9 @@ def configure_repo(self, validate=False, pull=True):
self.repository.configure_remote(
self.repo, self.push, self.branch, fast=not self.id
)
self.repository.set_committer(self.committer_name, self.committer_email)
self.repository.set_committer(
settings.DEFAULT_COMMITER_NAME, settings.DEFAULT_COMMITER_EMAIL
)

if pull:
self.update_remote_branch(validate)
Expand Down

0 comments on commit 2150087

Please sign in to comment.