Commit 7679575d authored by Michal Čihař's avatar Michal Čihař

Set default branch when saving rather than when validating

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 1cf54203
......@@ -1098,10 +1098,6 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
_('Unsupported file format: {0}').format(self.file_format)
)
# Set default VCS branch if empty
if self.branch == '':
self.branch = self.vcs.default_branch
# Validate VCS repo
try:
self.sync_git_repo(True)
......@@ -1150,6 +1146,11 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
Save wrapper which updates backend repository and regenerates
translation data.
'''
# Set default VCS branch if empty
if self.branch == '':
self.branch = self.vcs.default_branch
# Detect if VCS config has changed (so that we have to pull the repo)
changed_git = True
changed_setup = False
......
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