[translation] include branch into primary key

Translation statistics records can be identified
using user_id, project name (module), translated date (date),
and branch name (branch). There can be several records
for the same project and date, but different branches.
Those records cannot be distinguished without branch
on the translation primary key.

Change-Id: I93059b62247ea3a7924f15dd610106d2bb5aaacb
This commit is contained in:
Ian Y. Choi
2016-05-26 08:38:11 +09:00
parent a671763b6e
commit 5d34eaa48e

View File

@@ -616,8 +616,8 @@ class RecordProcessor(object):
user_id = user_processor.make_user_id(zanata_id=record['zanata_id'])
translation['record_type'] = 'tr'
translation['primary_key'] = '%s:%s:%s' % (
user_id, record['module'], record['date'])
translation['primary_key'] = '%s:%s:%s:%s' % (
user_id, record['module'], record['date'], record['branch'])
translation['author_name'] = user_id
# following fields are put into standard fields stored in dashboard mem