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

Better name for dictionary merge

Merging is more obvious naming than conflict.
parent 8b80c5d4
......@@ -295,9 +295,8 @@ class DictUploadForm(forms.Form):
file = forms.FileField(
label=_('File')
)
conflict = forms.ChoiceField(
label=_('Conflict handling'),
help_text=_('Imported word is already existing in the glossary'),
method = forms.ChoiceField(
label=_('Merge method'),
choices=(
('', _('Keep current')),
('overwrite', _('Overwrite existing')),
......
......@@ -443,7 +443,7 @@ class UnitManager(models.Manager):
class DictionaryManager(models.Manager):
def upload(self, project, language, fileobj, conflict):
def upload(self, project, language, fileobj, method):
'''
Handles dictionary update.
'''
......@@ -474,14 +474,14 @@ class DictionaryManager(models.Manager):
# Same as current -> ignore
if unit.target == word.target:
continue
if conflict == 'add':
if method == 'add':
# Add word
word = self.create(
project=project,
language=language,
source=unit.source
)
elif conflict != 'overwrite':
elif method != 'overwrite':
# No overwriting or adding
continue
......
......@@ -85,7 +85,7 @@ class DictionaryTest(ViewTestCase):
word.save()
# Import file again with orverwriting
response = self.import_tbx(conflict='overwrite')
response = self.import_tbx(method='overwrite')
# Check number of imported objects
self.assertEquals(Dictionary.objects.count(), 164)
......@@ -100,7 +100,7 @@ class DictionaryTest(ViewTestCase):
word.save()
# Import file again with adding
response = self.import_tbx(conflict='add')
response = self.import_tbx(method='add')
# Check number of imported objects
self.assertEquals(Dictionary.objects.count(), 165)
......
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