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

Log repository push to history

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent d15c94ed
......@@ -152,6 +152,7 @@ class Change(models.Model):
ACTION_UNLOCK = 15
ACTION_DUPLICATE_STRING = 16
ACTION_COMMIT = 17
ACTION_PUSH = 18
ACTION_CHOICES = (
(ACTION_UPDATE, ugettext_lazy('Resource update')),
......@@ -172,6 +173,7 @@ class Change(models.Model):
(ACTION_UNLOCK, ugettext_lazy('Component unlocked')),
(ACTION_DUPLICATE_STRING, ugettext_lazy('Detected duplicate string')),
(ACTION_COMMIT, ugettext_lazy('Commited changes')),
(ACTION_PUSH, ugettext_lazy('Pushed changes')),
)
unit = models.ForeignKey('Unit', null=True)
......
......@@ -703,6 +703,13 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
self.log_info('pushing to remote repo')
with self.repository_lock:
self.repository.push(self.branch)
if self.translation_set.exists():
Change.objects.create(
action=Change.ACTION_PUSH,
translation=self.translation_set.all()[0],
)
return True
except RepositoryException as error:
self.log_error('failed to push on repo: %s', error)
......
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