Commit 65267b82 authored by Michal Čihař's avatar Michal Čihař

Remove leading ./ from paths (fixes #338)

parent 5597979d
......@@ -949,6 +949,14 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
if changed_git:
self.sync_git_repo()
# Remove leading ./ from paths
if self.filemask.startswith('./'):
self.filemask = self.filemask[2:]
if self.template.startswith('./'):
self.template = self.template[2:]
if self.extra_commit_file.startswith('./'):
self.extra_commit_file = self.extra_commit_file[2:]
# Save/Create object
super(SubProject, self).save(*args, **kwargs)
......
......@@ -298,6 +298,15 @@ class SubProjectTest(RepoTestCase):
self.verify_subproject(project, 3, 'cs', 4)
self.assertTrue(os.path.exists(project.get_path()))
def test_create_dot(self):
project = self._create_subproject(
'auto',
'./po/*.po',
)
self.verify_subproject(project, 3, 'cs', 4)
self.assertTrue(os.path.exists(project.get_path()))
self.assertEqual('po/*.po', project.filemask)
def test_rename(self):
subproject = self.create_subproject()
old_path = subproject.get_path()
......
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