Commit 8944bc8d authored by Michal Čihař's avatar Michal Čihař

Ensure the units are unique in the database

This will make the errors appear when they happen rather than later.

Issue #1080
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 9f9b0abd
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-19 14:29
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('trans', '0061_auto_20160404_1841'),
]
operations = [
migrations.AlterUniqueTogether(
name='unit',
unique_together=set([('translation', 'checksum')]),
),
]
......@@ -357,6 +357,7 @@ class Unit(models.Model, LoggerMixin):
)
ordering = ['priority', 'position']
app_label = 'trans'
unique_together = ('translation', 'checksum')
def __init__(self, *args, **kwargs):
"""
......
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