Commit 89a7da30 authored by Michal Čihař's avatar Michal Čihař

Move author definition

parent c5892f62
......@@ -222,12 +222,11 @@ class Translation(models.Model):
self.revision = blob.hexsha
self.save()
def git_commit(self, request):
def git_commit(self, author):
'''
Commits translation to git.
'''
repo = self.subproject.get_repo()
author = '%s <%s>' % (request.user.get_full_name(), request.user.email)
logger.info('Commiting %s as %s', self.filename, author)
repo.git.commit(
self.filename,
......@@ -254,8 +253,9 @@ class Translation(models.Model):
# We should have only one match
break
if need_save:
author = '%s <%s>' % (request.user.get_full_name(), request.user.email)
store.save()
self.git_commit(request)
self.git_commit(author)
class Unit(models.Model):
translation = models.ForeignKey(Translation)
......
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