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

Use commit_message from a resource

Issue #507
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent aa888c68
......@@ -771,7 +771,7 @@ class Translation(models.Model, URLMixin, PercentMixin, LoggerMixin):
'''
Formats commit message based on project configuration.
'''
msg = self.subproject.project.commit_message % {
msg = self.subproject.commit_message % {
'language': self.language_code,
'language_name': self.language.name,
'subproject': self.subproject.name,
......
......@@ -247,18 +247,6 @@ class ProjectTest(RepoTestCase):
appsettings.GIT_ROOT = backup
def test_validation(self):
project = self.create_project()
# Correct project
project.full_clean()
# Invalid commit message
project.commit_message = '%(foo)s'
self.assertRaisesMessage(
ValidationError,
'Bad format string',
project.full_clean
)
def test_acl(self):
"""
Test for ACL handling.
......@@ -496,6 +484,14 @@ class SubProjectTest(RepoTestCase):
# Correct project
project.full_clean()
# Invalid commit message
project.commit_message = '%(foo)s'
self.assertRaisesMessage(
ValidationError,
'Bad format string',
project.full_clean
)
# Invalid mask
project.filemask = 'foo/x.po'
self.assertRaisesMessage(
......
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