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

Save object before updating Git repository

For working with the repository we should have object existing. This
allows change tracking, notifications and script hooks to work.

Fixes #811
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 0d68a923
......@@ -1311,10 +1311,6 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
# Detect slug changes and rename git repo
self.check_rename(old)
# Configure git repo if there were changes
if changed_git:
self.sync_git_repo()
# Remove leading ./ from paths
self.filemask = cleanup_path(self.filemask)
self.template = cleanup_path(self.template)
......@@ -1323,6 +1319,10 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
# Save/Create object
super(SubProject, self).save(*args, **kwargs)
# Configure git repo if there were changes
if changed_git:
self.sync_git_repo()
# Rescan for possibly new translations if there were changes, needs to
# be done after actual creating the object above
if changed_setup:
......
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