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

Do not push if not configured to do so

Otherwise we're showing error message for something user had not
explicitely ask for (issue #227).
parent 04f619ff
......@@ -432,7 +432,9 @@ class SubProject(models.Model):
self.create_translations(request=request)
# Push after possible merge
if self.git_needs_push() and self.project.push_on_commit:
if (self.git_needs_push()
and self.project.push_on_commit
and self.can_push()):
self.do_push(request, force_commit=False, do_update=False)
return ret
......
......@@ -790,7 +790,9 @@ class Translation(models.Model):
self.__git_commit(gitrepo, author, timestamp, sync)
# Push if we should
if self.subproject.project.push_on_commit and not skip_push:
if (self.subproject.project.push_on_commit
and not skip_push
and self.can_push()):
self.subproject.do_push(request, force_commit=False)
return True
......
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