Commit f16da835 authored by Michal Čihař's avatar Michal Čihař

Add model fields for custom script processing (issue #221)

parent 58cffe6c
...@@ -37,6 +37,7 @@ from trans.util import is_repo_link ...@@ -37,6 +37,7 @@ from trans.util import is_repo_link
from trans.util import get_site_url from trans.util import get_site_url
from trans.util import sleep_while_git_locked from trans.util import sleep_while_git_locked
from trans.validators import validate_repoweb, validate_filemask, validate_repo from trans.validators import validate_repoweb, validate_filemask, validate_repo
from weblate.appsettings import SCRIPT_CHOICES
class SubProjectManager(models.Manager): class SubProjectManager(models.Manager):
...@@ -128,6 +129,26 @@ class SubProject(models.Model, PercentMixin, URLMixin): ...@@ -128,6 +129,26 @@ class SubProject(models.Model, PercentMixin, URLMixin):
'and is slightly slower.' 'and is slightly slower.'
), ),
) )
extra_commit_file = models.CharField(
max_length=200,
default='',
blank=True,
validators=[validate_filemask],
help_text=ugettext_lazy(
'Additional file to include in commits, please check '
'documentation for more details.',
)
)
pre_commit_script = models.CharField(
max_length=200,
default='',
blank=True,
choices=SCRIPT_CHOICES,
help_text=ugettext_lazy(
'Script to be executed before commiting translation.'
),
)
locked = models.BooleanField( locked = models.BooleanField(
default=False, default=False,
help_text=ugettext_lazy( help_text=ugettext_lazy(
......
...@@ -111,3 +111,5 @@ MACHINE_TRANSLATION_SERVICES = get('MACHINE_TRANSLATION_SERVICES', ()) ...@@ -111,3 +111,5 @@ MACHINE_TRANSLATION_SERVICES = get('MACHINE_TRANSLATION_SERVICES', ())
# Whether machine translations are enabled # Whether machine translations are enabled
MACHINE_TRANSLATION_ENABLED = len(MACHINE_TRANSLATION_SERVICES) > 0 MACHINE_TRANSLATION_ENABLED = len(MACHINE_TRANSLATION_SERVICES) > 0
SCRIPT_CHOICES = (('', ''),)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment