diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-09 23:36:36 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-09 23:36:36 +0100 | 
| commit | 8eb09a666e7048ce8e531649566418670d94036d (patch) | |
| tree | 7a886afebba1df5ecf69524a5b4d0373eff7c3f9 | |
| parent | 54779a8fa14fa5213ef62b85c767545dd4f15257 (diff) | |
| parent | 02acc8610f34968cdeff8ea9cdd2129b36aa4809 (diff) | |
| download | Ishtar-8eb09a666e7048ce8e531649566418670d94036d.tar.bz2 Ishtar-8eb09a666e7048ce8e531649566418670d94036d.zip | |
Merge branch 'master' into v0.9
| -rw-r--r-- | CHANGES.md | 1 | ||||
| -rw-r--r-- | archaeological_finds/tests.py | 6 | ||||
| -rw-r--r-- | ishtar_common/data_importer.py | 4 | 
3 files changed, 8 insertions, 3 deletions
| diff --git a/CHANGES.md b/CHANGES.md index 7747fd5fc..76edd8b3d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,7 @@ v0.99.15 (2017-03-09)  ### Bug fixes ###  - Person: raw name is modified on save  - Export: allow models_finds and models_treatments settings +- Export: manage empty m2m  v0.99.14 (2017-03-06)  --------------------- diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py index cec73de8a..e274c757f 100644 --- a/archaeological_finds/tests.py +++ b/archaeological_finds/tests.py @@ -235,7 +235,7 @@ class ImportFindTest(ImportTest, TestCase):                                              importer_type_id=MCC.pk)          formater = FormaterType.objects.filter(              formater_type='FileFormater').all()[0] -        ImportTarget.objects.create(target='find__image', +        ImportTarget.objects.create(target='image',                                      formater_type_id=formater.pk,                                      column_id=col.pk)          mcc_file = open( @@ -259,8 +259,8 @@ class ImportFindTest(ImportTest, TestCase):          # doing manual connections          ceram = models.MaterialType.objects.get(txt_idx='ceramic').pk          glass = models.MaterialType.objects.get(txt_idx='glass').pk -        self.set_target_key('find__material_types', 'terre-cuite', ceram) -        self.set_target_key('find__material_types', 'verre', glass) +        self.set_target_key('material_types', 'terre-cuite', ceram) +        self.set_target_key('material_types', 'verre', glass)          impt.importation()          # new finds has now been imported          current_nb = models.BaseFind.objects.count() diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py index d4000b4c1..10957e74d 100644 --- a/ishtar_common/data_importer.py +++ b/ishtar_common/data_importer.py @@ -1406,6 +1406,10 @@ class Importer(object):                  data.pop(attribute)                  continue              if not data[attribute]: +                field_object, model, direct, m2m = \ +                    cls._meta.get_field_by_name(attribute) +                if m2m: +                    data.pop(attribute)                  continue              if attribute != '__force_new':                  self.get_field(cls, attribute, data, m2ms, c_c_path, | 
