summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.md11
-rw-r--r--Makefile.example3
-rw-r--r--archaeological_context_records/models.py20
-rw-r--r--archaeological_context_records/tests.py64
-rw-r--r--archaeological_files/tests.py23
-rw-r--r--archaeological_finds/fixtures/initial_data-fr.json15
-rw-r--r--archaeological_finds/models_finds.py6
-rw-r--r--archaeological_finds/tests.py104
-rw-r--r--archaeological_operations/fixtures/initial_data-fr.json50
-rw-r--r--archaeological_operations/tests.py87
-rw-r--r--archaeological_warehouse/tests.py21
-rwxr-xr-xexample_project/media/upload/templates/ISHTAR_FILE_ACT_AR_Neutre_1.odtbin0 -> 49419 bytes
-rwxr-xr-xexample_project/media/upload/templates/document_reference.odtbin0 -> 10678 bytes
-rw-r--r--ishtar_common/data_importer.py6
-rw-r--r--ishtar_common/fixtures/initial_data-fr.json46
-rw-r--r--ishtar_common/fixtures/initial_importtypes-fr.json402
-rw-r--r--ishtar_common/tests.py26
-rw-r--r--ishtar_common/wizards.py4
-rw-r--r--version.py2
19 files changed, 649 insertions, 241 deletions
diff --git a/CHANGES.md b/CHANGES.md
index 198be8ce3..16124023a 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,6 +1,17 @@
Ishtar changelog
================
+v0.99.26 (2017-07-26)
+---------------------
+### Features ###
+- Import: add FieldDoesNotExist to possible error on imports
+- Add reference documents
+- Update fixtures
+
+### Bug fixes ###
+- Datings: post-fix of duplicates associated to the same object (usually on imports)
+- Tests: fix fixtures management
+
v0.99.25 (2017-07-20)
---------------------
### Features ###
diff --git a/Makefile.example b/Makefile.example
index 8f0e2e72c..1e0545ef7 100644
--- a/Makefile.example
+++ b/Makefile.example
@@ -116,7 +116,7 @@ makemessages:
for DIR in $(apps); do \
cd $(CURDIR)/$$DIR; \
$(PYTHON) ../$(project)/manage.py makemessages --all; \
- msgfilter -i locale/fr/LC_MESSAGES/django.po -o locale/django.pot true; \
+ msgfilter -i locale/fr/LC_MESSAGES/django.po sed -e d | sed -e "s/fuzzy//g" > locale/django.pot ;\
done
compilemessages:
@@ -171,6 +171,7 @@ fixtures_common: fixtures_common_importers fixtures_spatialrefsystem
ishtar_common.titletype \
ishtar_common.supporttype \
ishtar_common.format \
+ ishtar_common.documenttemplate \
> '../ishtar_common/fixtures/initial_data-'$(default_data)'.json'
fixtures_common_importers:
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index 940330d86..a5f02133e 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -74,6 +74,20 @@ class Dating(models.Model):
return unicode(self.period)
return u"%s (%s-%s)" % (self.period, start_date, end_date)
+ @classmethod
+ def fix_dating_association(cls, obj):
+ """
+ Fix redundant m2m dating association (usually after imports)
+ """
+ current_datings = []
+ for dating in obj.datings.order_by('pk').all():
+ key = (dating.period.pk, dating.start_date, dating.end_date,
+ dating.dating_type, dating.quality, dating.precise_dating)
+ if key not in current_datings:
+ current_datings.append(key)
+ continue
+ dating.delete()
+
class Unit(GeneralType):
order = models.IntegerField(_(u"Order"))
@@ -493,6 +507,12 @@ class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms,
self.save()
return returned
+ def fix(self):
+ """
+ Fix redundant m2m dating association (usually after imports)
+ """
+ Dating.fix_dating_association(self)
+
post_save.connect(cached_label_changed, sender=ContextRecord)
diff --git a/archaeological_context_records/tests.py b/archaeological_context_records/tests.py
index b613b837e..7277eaef0 100644
--- a/archaeological_context_records/tests.py
+++ b/archaeological_context_records/tests.py
@@ -29,7 +29,7 @@ from django.test.client import Client
from ishtar_common.models import IshtarSiteProfile, ImporterModel
from archaeological_operations.tests import OperationInitTest, \
- ImportTest, ImportOperationTest
+ ImportTest, FILE_TOWNS_FIXTURES, FILE_FIXTURES, OPERATION_TOWNS_FIXTURES
from archaeological_operations import models as models_ope
from archaeological_context_records import models
@@ -38,12 +38,19 @@ from ishtar_common.tests import WizardTest, WizardTestFormData as FormData, \
from archaeological_context_records import views
-class ImportContextRecordTest(ImportTest, TestCase):
+CONTEXT_RECORD_FIXTURES = FILE_FIXTURES + [
+ settings.ROOT_PATH +
+ '../archaeological_context_records/fixtures/initial_data-fr.json',
+]
- fixtures = ImportOperationTest.fixtures + [
- settings.ROOT_PATH +
- '../archaeological_context_records/fixtures/initial_data-fr.json',
- ]
+CONTEXT_RECORD_TOWNS_FIXTURES = FILE_TOWNS_FIXTURES + [
+ settings.ROOT_PATH +
+ '../archaeological_context_records/fixtures/initial_data-fr.json',
+]
+
+
+class ImportContextRecordTest(ImportTest, TestCase):
+ fixtures = CONTEXT_RECORD_TOWNS_FIXTURES
def test_mcc_import_contextrecords(self):
old_nb = models.ContextRecord.objects.count()
@@ -193,7 +200,7 @@ class ContextRecordInit(OperationInitTest):
class ExportTest(ContextRecordInit, TestCase):
- fixtures = ImportContextRecordTest.fixtures
+ fixtures = CONTEXT_RECORD_TOWNS_FIXTURES
def setUp(self):
self.username, self.password, self.user = create_superuser()
@@ -222,7 +229,7 @@ class ExportTest(ContextRecordInit, TestCase):
class ContextRecordTest(ContextRecordInit, TestCase):
- fixtures = ImportContextRecordTest.fixtures
+ fixtures = CONTEXT_RECORD_TOWNS_FIXTURES
def setUp(self):
IshtarSiteProfile.objects.create()
@@ -352,9 +359,24 @@ class ContextRecordTest(ContextRecordInit, TestCase):
self.assertEqual(response.status_code, 200)
self.assertIn('class="sheet"', response.content)
+ def test_redundant_dating_clean(self):
+ obj = self.context_records[0]
+ values = {'period': models.Period.objects.all()[0]}
+ values_2 = {'period': models.Period.objects.all()[0],
+ 'quality': models.DatingQuality.objects.all()[0]}
+
+ obj.datings.add(models.Dating.objects.create(**values))
+ obj.datings.add(models.Dating.objects.create(**values))
+ obj.datings.add(models.Dating.objects.create(**values_2))
+ obj.datings.add(models.Dating.objects.create(**values_2))
+ self.assertEqual(obj.datings.count(), 4)
+ obj.fix()
+ self.assertEqual(obj.datings.count(), 2)
+
+
class ContextRecordSearchTest(ContextRecordInit, TestCase):
- fixtures = ImportContextRecordTest.fixtures
+ fixtures = CONTEXT_RECORD_TOWNS_FIXTURES
def setUp(self):
IshtarSiteProfile.objects.create()
@@ -496,7 +518,7 @@ class ContextRecordSearchTest(ContextRecordInit, TestCase):
class RecordRelationsTest(ContextRecordInit, TestCase):
- fixtures = ImportOperationTest.fixtures
+ fixtures = OPERATION_TOWNS_FIXTURES
model = models.ContextRecord
def setUp(self):
@@ -546,7 +568,7 @@ class RecordRelationsTest(ContextRecordInit, TestCase):
class ContextRecordWizardCreationTest(WizardTest, ContextRecordInit, TestCase):
- fixtures = ImportOperationTest.fixtures
+ fixtures = OPERATION_TOWNS_FIXTURES
url_name = 'record_creation'
wizard_name = 'record_wizard'
steps = views.record_creation_steps
@@ -558,22 +580,23 @@ class ContextRecordWizardCreationTest(WizardTest, ContextRecordInit, TestCase):
'general': {
'label': "First"
},
- 'relations': []
+ 'relations': [],
},
ignored=('datings',
'interpretation',
)
),
FormData(
- "Create a context record with a relation",
+ "Create a context record with a relation and datings",
form_datas={
'selec': {},
'general': {
'label': "Second"
},
- 'relations': []
+ 'relations': [],
+ 'datings': []
},
- ignored=('datings', 'interpretation',)
+ ignored=('interpretation',)
),
]
@@ -598,6 +621,14 @@ class ContextRecordWizardCreationTest(WizardTest, ContextRecordInit, TestCase):
label="Test").pk}
)
+ period = models.Period.objects.all()[0].pk
+ self.form_datas[1].append(
+ 'datings', {'period': period}
+ )
+ self.form_datas[1].append(
+ 'datings', {'period': period}
+ )
+
self.cr_nb = models.ContextRecord.objects.count()
super(ContextRecordWizardCreationTest, self).pre_wizard()
@@ -606,3 +637,6 @@ class ContextRecordWizardCreationTest(WizardTest, ContextRecordInit, TestCase):
self.cr_nb + 2)
self.assertEqual(self.related_cr.left_relations.count(),
1)
+ # identical datings, only one should be finaly save
+ cr = models.ContextRecord.objects.order_by('-pk')[0]
+ self.assertEqual(cr.datings.count(), 1)
diff --git a/archaeological_files/tests.py b/archaeological_files/tests.py
index 82f85e7c9..b23c91a95 100644
--- a/archaeological_files/tests.py
+++ b/archaeological_files/tests.py
@@ -25,12 +25,13 @@ from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test.client import Client
-from ishtar_common.tests import TestCase
+from ishtar_common.tests import TestCase, COMMON_FIXTURES
from ishtar_common.models import PersonType, Town, IshtarSiteProfile
from archaeological_files import models
from archaeological_operations.models import Parcel, ParcelOwner
-from archaeological_operations.tests import OperationInitTest
+from archaeological_operations.tests import OperationInitTest, \
+ FILE_TOWNS_FIXTURES
class FileInit(object):
@@ -69,10 +70,7 @@ class FileInit(object):
class FileTest(TestCase, FileInit):
- fixtures = [settings.ROOT_PATH +
- '../fixtures/initial_data-auth-fr.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_data-fr.json']
+ fixtures = COMMON_FIXTURES
model = models.File
def setUp(self):
@@ -241,18 +239,7 @@ class FileTest(TestCase, FileInit):
class FileOperationTest(TestCase, OperationInitTest, FileInit):
model = models.File
- fixtures = [settings.ROOT_PATH +
- '../fixtures/initial_data-auth-fr.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_data-fr.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/test_towns.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_importtypes-fr.json',
- settings.ROOT_PATH +
- '../archaeological_files/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_operations/fixtures/initial_data-fr.json']
+ fixtures = FILE_TOWNS_FIXTURES
def setUp(self):
self.create_file()
diff --git a/archaeological_finds/fixtures/initial_data-fr.json b/archaeological_finds/fixtures/initial_data-fr.json
index b8f233f88..c7f0699b1 100644
--- a/archaeological_finds/fixtures/initial_data-fr.json
+++ b/archaeological_finds/fixtures/initial_data-fr.json
@@ -857,6 +857,21 @@
}
},
{
+ "pk": 20,
+ "model": "archaeological_finds.treatmenttype",
+ "fields": {
+ "comment": "Remontage virtuel : on sait que les \u00e9l\u00e9ments remontent ensemble, mais il n'y a pas eu de remontage physique p\u00e9renne.",
+ "available": true,
+ "downstream_is_many": false,
+ "parent": null,
+ "virtual": true,
+ "label": "Remontage virtuel",
+ "upstream_is_many": true,
+ "order": 10,
+ "txt_idx": "virtual-reassembly"
+ }
+ },
+ {
"pk": 6,
"model": "archaeological_finds.treatmentstate",
"fields": {
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index 4fea6edd3..78280bede 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -1095,6 +1095,12 @@ class Find(ValueGetter, BaseHistorizedItem, ImageModel, OwnPerms,
# base_find.material_index = \
# idx and idx['material_index__max'] + 1 or 1
+ def fix(self):
+ """
+ Fix redundant m2m dating association (usually after imports)
+ """
+ Dating.fix_dating_association(self)
+
post_save.connect(cached_label_changed, sender=Find)
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py
index 41e113245..f8f134c0a 100644
--- a/archaeological_finds/tests.py
+++ b/archaeological_finds/tests.py
@@ -38,8 +38,24 @@ from ishtar_common import forms_common
from ishtar_common.tests import WizardTest, WizardTestFormData as FormData, \
TestCase
from archaeological_operations.tests import ImportTest
-from archaeological_context_records.tests import ImportContextRecordTest, \
- ContextRecordInit
+from archaeological_context_records.tests import ContextRecordInit, \
+ CONTEXT_RECORD_FIXTURES, CONTEXT_RECORD_TOWNS_FIXTURES
+
+
+FIND_FIXTURES = CONTEXT_RECORD_FIXTURES + [
+ settings.ROOT_PATH +
+ '../archaeological_finds/fixtures/initial_data-fr.json',
+]
+
+FIND_TOWNS_FIXTURES = CONTEXT_RECORD_TOWNS_FIXTURES + [
+ settings.ROOT_PATH +
+ '../archaeological_finds/fixtures/initial_data-fr.json',
+]
+
+WAREHOUSE_FIXTURES = FIND_FIXTURES + [
+ settings.ROOT_PATH +
+ '../archaeological_warehouse/fixtures/initial_data-fr.json',
+]
class FindInit(ContextRecordInit):
@@ -92,19 +108,7 @@ class FindInit(ContextRecordInit):
class FindWizardCreationTest(WizardTest, FindInit, TestCase):
- fixtures = [settings.ROOT_PATH +
- '../fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_files/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_operations/fixtures/initial_data-fr.json',
- settings.ROOT_PATH +
- '../archaeological_finds/fixtures/initial_data-fr.json',
- settings.ROOT_PATH +
- '../archaeological_warehouse/fixtures/initial_data-fr.json',
- ]
+ fixtures = WAREHOUSE_FIXTURES
url_name = 'find_creation'
wizard_name = 'find_wizard'
steps = views.find_creation_steps
@@ -123,6 +127,11 @@ class FindWizardCreationTest(WizardTest, FindInit, TestCase):
'period': None,
'start_date': '0',
'end_date': '200',
+ },
+ {
+ 'period': None,
+ 'start_date': '0',
+ 'end_date': '200',
}
]
},
@@ -135,8 +144,11 @@ class FindWizardCreationTest(WizardTest, FindInit, TestCase):
self.form_datas[0].form_datas['selecrecord-find_creation']['pk'] = \
cr.pk
+ period = Period.objects.all()[0].pk
self.form_datas[0].form_datas['dating-find_creation'][0]['period'] = \
- Period.objects.all()[0].pk
+ period
+ self.form_datas[0].form_datas['dating-find_creation'][1]['period'] = \
+ period
self.find_number = models.Find.objects.count()
self.basefind_number = models.BaseFind.objects.count()
super(FindWizardCreationTest, self).pre_wizard()
@@ -146,10 +158,13 @@ class FindWizardCreationTest(WizardTest, FindInit, TestCase):
self.basefind_number + 1)
self.assertEqual(models.Find.objects.count(),
self.find_number + 1)
+ # identical datings, only one should be finaly save
+ f = models.Find.objects.order_by("-pk").all()[0]
+ self.assertEqual(f.datings.count(), 1)
class FindWizardDeletionWithWarehouseModTest(WizardTest, FindInit, TestCase):
- fixtures = FindWizardCreationTest.fixtures
+ fixtures = WAREHOUSE_FIXTURES
url_name = 'find_deletion'
wizard_name = 'find_deletion_wizard'
steps = views.find_deletion_steps
@@ -180,19 +195,7 @@ class FindWizardDeletionWithWarehouseModTest(WizardTest, FindInit, TestCase):
class TreatmentWizardCreationTest(WizardTest, FindInit, TestCase):
- fixtures = [settings.ROOT_PATH +
- '../fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_files/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_operations/fixtures/initial_data-fr.json',
- settings.ROOT_PATH +
- '../archaeological_finds/fixtures/initial_data-fr.json',
- settings.ROOT_PATH +
- '../archaeological_warehouse/fixtures/initial_data-fr.json',
- ]
+ fixtures = WAREHOUSE_FIXTURES
url_name = 'treatment_creation'
wizard_name = 'treatment_wizard'
steps = views.treatment_wizard_steps
@@ -250,10 +253,7 @@ class TreatmentWizardCreationTest(WizardTest, FindInit, TestCase):
class ImportFindTest(ImportTest, TestCase):
- fixtures = ImportContextRecordTest.fixtures + [
- settings.ROOT_PATH +
- '../archaeological_finds/fixtures/initial_data-fr.json',
- ]
+ fixtures = FIND_TOWNS_FIXTURES
def test_mcc_import_finds(self):
self.init_context_record()
@@ -307,17 +307,7 @@ class ImportFindTest(ImportTest, TestCase):
class FindTest(FindInit, TestCase):
- fixtures = [settings.ROOT_PATH +
- '../fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_files/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_operations/fixtures/initial_data-fr.json',
- settings.ROOT_PATH +
- '../archaeological_finds/fixtures/initial_data-fr.json',
- ]
+ fixtures = FIND_FIXTURES
model = models.Find
def setUp(self):
@@ -424,17 +414,7 @@ class FindTest(FindInit, TestCase):
class FindSearchTest(FindInit, TestCase):
- fixtures = [settings.ROOT_PATH +
- '../fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_files/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_operations/fixtures/initial_data-fr.json',
- settings.ROOT_PATH +
- '../archaeological_finds/fixtures/initial_data-fr.json',
- ]
+ fixtures = FIND_FIXTURES
model = models.Find
def setUp(self):
@@ -564,17 +544,7 @@ class FindSearchTest(FindInit, TestCase):
class PackagingTest(FindInit, TestCase):
- fixtures = [settings.ROOT_PATH +
- '../fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_files/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_operations/fixtures/initial_data-fr.json',
- settings.ROOT_PATH +
- '../archaeological_finds/fixtures/initial_data-fr.json',
- ]
+ fixtures = FIND_FIXTURES
model = models.Find
def setUp(self):
diff --git a/archaeological_operations/fixtures/initial_data-fr.json b/archaeological_operations/fixtures/initial_data-fr.json
index 304f07a38..214ab9cad 100644
--- a/archaeological_operations/fixtures/initial_data-fr.json
+++ b/archaeological_operations/fixtures/initial_data-fr.json
@@ -9,7 +9,9 @@
"intented_to": "F",
"label": "AR : Accus\u00e9 de r\u00e9ception dossier",
"indexed": false,
- "associated_template": [],
+ "associated_template": [
+ 2
+ ],
"txt_idx": "a_receipt"
}
},
@@ -317,7 +319,9 @@
"intented_to": "T",
"label": "Constat d'\u00e9tat",
"indexed": false,
- "associated_template": [],
+ "associated_template": [
+ 1
+ ],
"txt_idx": "observation_status"
}
},
@@ -728,6 +732,20 @@
}
},
{
+ "pk": 40,
+ "model": "archaeological_operations.period",
+ "fields": {
+ "comment": "",
+ "available": true,
+ "parent": 39,
+ "end_date": 0,
+ "order": 1,
+ "label": "Antiquit\u00e9 tardive (M\u00e9d.)",
+ "start_date": 0,
+ "txt_idx": "late_antiq_med"
+ }
+ },
+ {
"pk": 39,
"model": "archaeological_operations.period",
"fields": {
@@ -770,20 +788,6 @@
}
},
{
- "pk": 40,
- "model": "archaeological_operations.period",
- "fields": {
- "comment": "",
- "available": true,
- "parent": 39,
- "end_date": 0,
- "order": 1,
- "label": "Antiquit\u00e9 tardive (M\u00e9d.)",
- "start_date": 0,
- "txt_idx": "late_antiq_med"
- }
- },
- {
"pk": 41,
"model": "archaeological_operations.period",
"fields": {
@@ -1970,22 +1974,22 @@
}
},
{
- "pk": 221,
+ "pk": 2,
"model": "archaeological_operations.remaintype",
"fields": {
- "comment": null,
+ "comment": "",
"available": true,
- "txt_idx": "enclos",
+ "txt_idx": "enclosure",
"label": "enclos"
}
},
{
- "pk": 2,
+ "pk": 221,
"model": "archaeological_operations.remaintype",
"fields": {
- "comment": "",
+ "comment": null,
"available": true,
- "txt_idx": "enclosure",
+ "txt_idx": "enclos",
"label": "enclos"
}
},
@@ -3018,4 +3022,4 @@
"label": "Rapport inexistant"
}
}
-]
+] \ No newline at end of file
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py
index 2cb6dd035..a475667b1 100644
--- a/archaeological_operations/tests.py
+++ b/archaeological_operations/tests.py
@@ -37,7 +37,19 @@ from archaeological_context_records.models import Unit
from ishtar_common import forms_common
from ishtar_common.tests import WizardTest, WizardTestFormData as FormData, \
- create_superuser, create_user, TestCase
+ create_superuser, create_user, TestCase, OPERATION_FIXTURES
+
+OPERATION_TOWNS_FIXTURES = \
+ OPERATION_FIXTURES + \
+ [settings.ROOT_PATH + '../ishtar_common/fixtures/test_towns.json']
+
+FILE_FIXTURES = OPERATION_FIXTURES + [
+ settings.ROOT_PATH +
+ '../archaeological_files/fixtures/initial_data.json']
+
+FILE_TOWNS_FIXTURES = OPERATION_TOWNS_FIXTURES + [
+ settings.ROOT_PATH +
+ '../archaeological_files/fixtures/initial_data.json']
class ImportTest(object):
@@ -154,16 +166,7 @@ class ImportTest(object):
class ImportOperationTest(ImportTest, TestCase):
- fixtures = [settings.ROOT_PATH +
- '../fixtures/initial_data-auth-fr.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_data-fr.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/test_towns.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_importtypes-fr.json',
- settings.ROOT_PATH +
- '../archaeological_operations/fixtures/initial_data-fr.json']
+ fixtures = OPERATION_TOWNS_FIXTURES
def test_mcc_import_operation(self):
first_ope_nb = models.Operation.objects.count()
@@ -337,16 +340,7 @@ class ImportOperationTest(ImportTest, TestCase):
class ParcelTest(ImportTest, TestCase):
- fixtures = [settings.ROOT_PATH +
- '../fixtures/initial_data-auth-fr.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_data-fr.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/test_towns.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_importtypes-fr.json',
- settings.ROOT_PATH +
- '../archaeological_operations/fixtures/initial_data-fr.json']
+ fixtures = OPERATION_TOWNS_FIXTURES
def test_parse_parcels(self):
# the database needs to be initialised before importing
@@ -689,14 +683,7 @@ class OperationInitTest(object):
class OperationTest(TestCase, OperationInitTest):
- fixtures = [settings.ROOT_PATH +
- '../fixtures/initial_data-auth-fr.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_data-fr.json',
- settings.ROOT_PATH +
- '../archaeological_files/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_operations/fixtures/initial_data-fr.json']
+ fixtures = FILE_FIXTURES
def setUp(self):
IshtarSiteProfile.objects.get_or_create(
@@ -890,14 +877,7 @@ class OperationTest(TestCase, OperationInitTest):
class OperationSearchTest(TestCase, OperationInitTest):
- fixtures = [settings.ROOT_PATH +
- '../fixtures/initial_data-auth-fr.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_data-fr.json',
- settings.ROOT_PATH +
- '../archaeological_files/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_operations/fixtures/initial_data-fr.json']
+ fixtures = FILE_FIXTURES
def setUp(self):
IshtarSiteProfile.objects.get_or_create(
@@ -1011,12 +991,7 @@ def create_administrativact(user, operation):
class RegisterTest(TestCase, OperationInitTest):
- fixtures = [settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_files/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_operations/fixtures/initial_data-fr.json']
+ fixtures = FILE_FIXTURES
def setUp(self):
self.username, self.password, self.user = create_superuser()
@@ -1037,14 +1012,7 @@ class RegisterTest(TestCase, OperationInitTest):
class OperationWizardCreationTest(WizardTest, OperationInitTest, TestCase):
- fixtures = [settings.ROOT_PATH +
- '../fixtures/initial_data-auth-fr.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_data-fr.json',
- settings.ROOT_PATH +
- '../archaeological_files/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_operations/fixtures/initial_data-fr.json']
+ fixtures = FILE_FIXTURES
url_name = 'operation_creation'
wizard_name = 'operation_wizard'
steps = views.wizard_steps
@@ -1113,7 +1081,7 @@ class OperationWizardCreationTest(WizardTest, OperationInitTest, TestCase):
class OperationWizardModifTest(WizardTest, OperationInitTest, TestCase):
- fixtures = OperationWizardCreationTest.fixtures
+ fixtures = FILE_FIXTURES
url_name = 'operation_modification'
wizard_name = url_name + '_wizard'
steps = views.operation_modif_wizard_steps
@@ -1265,7 +1233,7 @@ class OperationWizardModifTest(WizardTest, OperationInitTest, TestCase):
class OperationWizardDeleteTest(OperationWizardCreationTest):
- fixtures = OperationWizardCreationTest.fixtures
+ fixtures = FILE_FIXTURES
url_name = 'operation_deletion'
wizard_name = 'operation_deletion_wizard'
steps = views.operation_deletion_steps
@@ -1300,7 +1268,7 @@ class OperationWizardDeleteTest(OperationWizardCreationTest):
class OperationWizardClosingTest(OperationWizardCreationTest):
- fixtures = OperationWizardCreationTest.fixtures
+ fixtures = FILE_FIXTURES
url_name = 'operation_closing'
wizard_name = 'operation_closing_wizard'
steps = views.operation_closing_steps
@@ -1332,14 +1300,7 @@ class OperationWizardClosingTest(OperationWizardCreationTest):
class OperationAdminActWizardCreationTest(WizardTest, OperationInitTest,
TestCase):
- fixtures = [settings.ROOT_PATH +
- '../fixtures/initial_data-auth-fr.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_data-fr.json',
- settings.ROOT_PATH +
- '../archaeological_files/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_operations/fixtures/initial_data-fr.json']
+ fixtures = FILE_FIXTURES
url_name = 'operation_administrativeactop'
wizard_name = 'operation_administrative_act_wizard'
steps = views.administrativeactop_steps
@@ -1374,7 +1335,7 @@ class OperationAdminActWizardCreationTest(WizardTest, OperationInitTest,
class OperationSourceWizardModificationTest(WizardTest, OperationInitTest,
TestCase):
- fixtures = OperationWizardCreationTest.fixtures
+ fixtures = FILE_FIXTURES
url_name = 'operation_source_modification'
wizard_name = 'operation_source_wizard'
steps = views.operation_source_modification_steps
diff --git a/archaeological_warehouse/tests.py b/archaeological_warehouse/tests.py
index 10b2318b2..cf3c1febc 100644
--- a/archaeological_warehouse/tests.py
+++ b/archaeological_warehouse/tests.py
@@ -23,26 +23,13 @@ from archaeological_finds.tests import FindInit
from ishtar_common.tests import WizardTest, WizardTestFormData as FormData, \
TestCase
+from archaeological_finds.tests import WAREHOUSE_FIXTURES
from archaeological_warehouse import models, views, forms
-warehouse_fixtures = [settings.ROOT_PATH +
- '../fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_files/fixtures/initial_data.json',
- settings.ROOT_PATH +
- '../archaeological_operations/fixtures/initial_data-fr.json',
- settings.ROOT_PATH +
- '../archaeological_finds/fixtures/initial_data-fr.json',
- settings.ROOT_PATH +
- '../archaeological_warehouse/fixtures/initial_data-fr.json',
- ]
-
class WarehouseWizardCreationTest(WizardTest, FindInit, TestCase):
- fixtures = warehouse_fixtures
+ fixtures = WAREHOUSE_FIXTURES
url_name = 'warehouse_creation'
wizard_name = 'warehouse_wizard'
steps = views.warehouse_creation_steps
@@ -103,7 +90,7 @@ class WarehouseWizardCreationTest(WizardTest, FindInit, TestCase):
class ContainerWizardCreationTest(WizardTest, FindInit, TestCase):
- fixtures = warehouse_fixtures
+ fixtures = WAREHOUSE_FIXTURES
url_name = 'container_creation'
wizard_name = 'container_wizard'
steps = views.container_creation_steps
@@ -185,7 +172,7 @@ class ContainerWizardCreationTest(WizardTest, FindInit, TestCase):
class ContainerTest(FindInit, TestCase):
- fixtures = warehouse_fixtures
+ fixtures = WAREHOUSE_FIXTURES
def testFormCreation(self):
main_warehouse = models.Warehouse.objects.create(
diff --git a/example_project/media/upload/templates/ISHTAR_FILE_ACT_AR_Neutre_1.odt b/example_project/media/upload/templates/ISHTAR_FILE_ACT_AR_Neutre_1.odt
new file mode 100755
index 000000000..2ed93861e
--- /dev/null
+++ b/example_project/media/upload/templates/ISHTAR_FILE_ACT_AR_Neutre_1.odt
Binary files differ
diff --git a/example_project/media/upload/templates/document_reference.odt b/example_project/media/upload/templates/document_reference.odt
new file mode 100755
index 000000000..acda588fb
--- /dev/null
+++ b/example_project/media/upload/templates/document_reference.odt
Binary files differ
diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py
index e11e72449..3bb65fc21 100644
--- a/ishtar_common/data_importer.py
+++ b/ishtar_common/data_importer.py
@@ -1415,8 +1415,7 @@ class Importer(object):
if attribute != '__force_new':
self.get_field(cls, attribute, data, m2ms, c_c_path,
new_created)
- except (ValueError, IntegrityError) as e:
- message = e.message
+ except (ValueError, IntegrityError, FieldDoesNotExist) as e:
try:
message = e.message.decode('utf-8')
except (UnicodeDecodeError, UnicodeDecodeError):
@@ -1538,6 +1537,9 @@ class Importer(object):
if m2ms:
# force post save script
obj.save()
+ if hasattr(obj, 'fix'):
+ # post save/m2m specific fix
+ obj.fix()
except IntegrityError as e:
message = e.message
try:
diff --git a/ishtar_common/fixtures/initial_data-fr.json b/ishtar_common/fixtures/initial_data-fr.json
index 9255c604e..b4447559e 100644
--- a/ishtar_common/fixtures/initial_data-fr.json
+++ b/ishtar_common/fixtures/initial_data-fr.json
@@ -212,6 +212,7 @@
83,
84,
78,
+ 54,
58,
59,
60,
@@ -337,26 +338,27 @@
"txt_idx": "head_scientist",
"groups": [
1,
+ 40,
+ 41,
+ 42,
+ 46,
+ 47,
+ 48,
50,
+ 54,
+ 58,
+ 59,
+ 60,
+ 63,
70,
71,
72,
- 41,
74,
77,
- 46,
- 47,
- 48,
- 40,
+ 78,
82,
83,
- 84,
- 78,
- 58,
- 59,
- 60,
- 42,
- 63
+ 84
],
"label": "Responsable scientifique"
}
@@ -1155,5 +1157,25 @@
"txt_idx": "a6",
"label": "A6"
}
+ },
+ {
+ "pk": 2,
+ "model": "ishtar_common.documenttemplate",
+ "fields": {
+ "associated_object_name": "archaeological_operations.models.AdministrativeAct",
+ "available": true,
+ "name": "Accus\u00e9 de r\u00e9ception d'un dossier",
+ "template": "upload/templates/ISHTAR_FILE_ACT_AR_Neutre_1.odt"
+ }
+ },
+ {
+ "pk": 1,
+ "model": "ishtar_common.documenttemplate",
+ "fields": {
+ "associated_object_name": "archaeological_operations.models.AdministrativeAct",
+ "available": true,
+ "name": "Document de r\u00e9f\u00e9rence",
+ "template": "upload/templates/document_reference.odt"
+ }
}
] \ No newline at end of file
diff --git a/ishtar_common/fixtures/initial_importtypes-fr.json b/ishtar_common/fixtures/initial_importtypes-fr.json
index 115f6a985..3b43f0003 100644
--- a/ishtar_common/fixtures/initial_importtypes-fr.json
+++ b/ishtar_common/fixtures/initial_importtypes-fr.json
@@ -150,6 +150,23 @@
}
},
{
+ "pk": 23,
+ "model": "ishtar_common.importertype",
+ "fields": {
+ "description": "Importeur de mobilier + parcelles et UE",
+ "created_models": [
+ 9,
+ 7
+ ],
+ "is_template": true,
+ "unicity_keys": "external_id",
+ "users": [],
+ "slug": "ishtar_finds_parcels_and_cr",
+ "associated_models": 12,
+ "name": "Ishtar - Mobilier_COMBO"
+ }
+ },
+ {
"pk": 17,
"model": "ishtar_common.importertype",
"fields": {
@@ -305,14 +322,6 @@
}
},
{
- "pk": 20,
- "model": "ishtar_common.importerdefault",
- "fields": {
- "importer_type": 3,
- "target": "authors"
- }
- },
- {
"pk": 1,
"model": "ishtar_common.importerdefault",
"fields": {
@@ -354,11 +363,10 @@
},
{
"pk": 26,
- "model": "ishtar_common.importerdefaultvalues",
+ "model": "ishtar_common.importerdefault",
"fields": {
- "default_target": 20,
- "target": "author_type",
- "value": "main_author"
+ "importer_type": 19,
+ "target": "public_domain"
}
},
{
@@ -407,6 +415,15 @@
}
},
{
+ "pk": 32,
+ "model": "ishtar_common.importerdefaultvalues",
+ "fields": {
+ "default_target": 26,
+ "target": "public_domain",
+ "value": "False"
+ }
+ },
+ {
"pk": 336,
"model": "ishtar_common.importercolumn",
"fields": {
@@ -888,6 +905,84 @@
}
},
{
+ "pk": 391,
+ "model": "ishtar_common.importercolumn",
+ "fields": {
+ "col_number": 1,
+ "description": "Code PATRIARCHE ou code num\u00e9rique (entier) UNIQUE pour une op\u00e9ration.",
+ "regexp_pre_filter": null,
+ "required": true,
+ "label": "Code op\u00e9ration",
+ "importer_type": 23,
+ "export_field_name": "base_finds__context_record__operation__code_patriarche"
+ }
+ },
+ {
+ "pk": 392,
+ "model": "ishtar_common.importercolumn",
+ "fields": {
+ "col_number": 2,
+ "description": "Commune (via num\u00e9ro INSEE).",
+ "regexp_pre_filter": null,
+ "required": true,
+ "label": "INSEE",
+ "importer_type": 23,
+ "export_field_name": "base_finds__context_record__parcel__town__numero_insee"
+ }
+ },
+ {
+ "pk": 393,
+ "model": "ishtar_common.importercolumn",
+ "fields": {
+ "col_number": 3,
+ "description": "Section (identifiant externe), soit des lettres formant la section . Exemple : \"ZA\".",
+ "regexp_pre_filter": null,
+ "required": true,
+ "label": "Section de parcellaire",
+ "importer_type": 23,
+ "export_field_name": "base_finds__context_record__parcel__section"
+ }
+ },
+ {
+ "pk": 394,
+ "model": "ishtar_common.importercolumn",
+ "fields": {
+ "col_number": 4,
+ "description": "Num\u00e9ro de la parcelle, soit des chiffres sans espaces. Exemple : \"253\".",
+ "regexp_pre_filter": null,
+ "required": true,
+ "label": "Num\u00e9ro de parcelle",
+ "importer_type": 23,
+ "export_field_name": "base_finds__context_record__parcel__parcel_number"
+ }
+ },
+ {
+ "pk": 395,
+ "model": "ishtar_common.importercolumn",
+ "fields": {
+ "col_number": 5,
+ "description": "Label / Identifiant (externe) de l'UE. Exemple : \"US 145\", \"Tranch\u00e9e 145\", \"145\", \"St 17\", etc. Doit \u00eatre unique pour une parcelle donn\u00e9e.",
+ "regexp_pre_filter": null,
+ "required": true,
+ "label": "Label UE",
+ "importer_type": 23,
+ "export_field_name": "base_finds__context_record__label"
+ }
+ },
+ {
+ "pk": 396,
+ "model": "ishtar_common.importercolumn",
+ "fields": {
+ "col_number": 6,
+ "description": "Identifiant libre pour le mobilier. Exemple : \"12\", \"Lot 24\", \"Sac vert\", etc.\r\nDoit \u00eatre unique \u00e0 l'\u00e9chelle de l'UE associ\u00e9e.",
+ "regexp_pre_filter": null,
+ "required": true,
+ "label": "Label mobilier",
+ "importer_type": 23,
+ "export_field_name": "label"
+ }
+ },
+ {
"pk": 265,
"model": "ishtar_common.importercolumn",
"fields": {
@@ -4676,6 +4771,76 @@
}
},
{
+ "pk": 417,
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "comment": "",
+ "target": "base_finds__context_record__external_id",
+ "column": 392,
+ "formater_type": 28,
+ "concat_str": "-",
+ "regexp_filter": null,
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
+ "pk": 421,
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "comment": "",
+ "target": "base_finds__label",
+ "column": 396,
+ "formater_type": 3,
+ "concat_str": "",
+ "regexp_filter": null,
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
+ "pk": 419,
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "comment": "",
+ "target": "base_finds__context_record__external_id",
+ "column": 394,
+ "formater_type": 35,
+ "concat_str": "-",
+ "regexp_filter": null,
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
+ "pk": 423,
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "comment": "",
+ "target": "base_finds__context_record__parcel__section",
+ "column": 393,
+ "formater_type": 7,
+ "concat_str": "",
+ "regexp_filter": null,
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
+ "pk": 425,
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "comment": "",
+ "target": "base_finds__context_record__parcel__town__numero_insee",
+ "column": 337,
+ "formater_type": 28,
+ "concat_str": "",
+ "regexp_filter": null,
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
"pk": 396,
"model": "ishtar_common.importtarget",
"fields": {
@@ -5082,6 +5247,20 @@
}
},
{
+ "pk": 416,
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "comment": "",
+ "target": "base_finds__context_record__external_id",
+ "column": 391,
+ "formater_type": 11,
+ "concat_str": "",
+ "regexp_filter": null,
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
"pk": 310,
"model": "ishtar_common.importtarget",
"fields": {
@@ -5250,6 +5429,34 @@
}
},
{
+ "pk": 418,
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "comment": "",
+ "target": "base_finds__context_record__external_id",
+ "column": 393,
+ "formater_type": 35,
+ "concat_str": "-",
+ "regexp_filter": null,
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
+ "pk": 420,
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "comment": "",
+ "target": "base_finds__context_record__external_id",
+ "column": 395,
+ "formater_type": 3,
+ "concat_str": "-",
+ "regexp_filter": null,
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
"pk": 355,
"model": "ishtar_common.importtarget",
"fields": {
@@ -5278,6 +5485,34 @@
}
},
{
+ "pk": 422,
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "comment": "",
+ "target": "base_finds__context_record__parcel__town__numero_insee",
+ "column": 392,
+ "formater_type": 11,
+ "concat_str": "",
+ "regexp_filter": null,
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
+ "pk": 424,
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "comment": "",
+ "target": "base_finds__context_record__parcel__parcel_number",
+ "column": 394,
+ "formater_type": 8,
+ "concat_str": "",
+ "regexp_filter": null,
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
"pk": 352,
"model": "ishtar_common.importtarget",
"fields": {
@@ -6258,5 +6493,148 @@
"concat": false,
"force_new": false
}
+ },
+ {
+ "pk": 54,
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": 391,
+ "concat_str": "-",
+ "field_name": "base_finds__external_id",
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
+ "pk": 55,
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": 391,
+ "concat_str": "-",
+ "field_name": "external_id",
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
+ "pk": 56,
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": 392,
+ "concat_str": "-",
+ "field_name": "base_finds__external_id",
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
+ "pk": 57,
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": 392,
+ "concat_str": "-",
+ "field_name": "external_id",
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
+ "pk": 58,
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": 393,
+ "concat_str": "-",
+ "field_name": "base_finds__external_id",
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
+ "pk": 59,
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": 393,
+ "concat_str": "-",
+ "field_name": "external_id",
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
+ "pk": 62,
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": 395,
+ "concat_str": "-",
+ "field_name": "base_finds__external_id",
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
+ "pk": 63,
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": 395,
+ "concat_str": "-",
+ "field_name": "external_id",
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
+ "pk": 64,
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": 396,
+ "concat_str": "",
+ "field_name": "label",
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
+ "pk": 65,
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": 396,
+ "concat_str": "-",
+ "field_name": "base_finds__external_id",
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
+ "pk": 66,
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": 396,
+ "concat_str": "-",
+ "field_name": "external_id",
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
+ "pk": 60,
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": 394,
+ "concat_str": "-",
+ "field_name": "base_finds__external_id",
+ "concat": false,
+ "force_new": false
+ }
+ },
+ {
+ "pk": 61,
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": 394,
+ "concat_str": "-",
+ "field_name": "external_id",
+ "concat": false,
+ "force_new": false
+ }
}
] \ No newline at end of file
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py
index 536d6d4a8..b862b4ea7 100644
--- a/ishtar_common/tests.py
+++ b/ishtar_common/tests.py
@@ -69,6 +69,21 @@ class OOOGenerationTest(TestCase):
"""
+COMMON_FIXTURES = [
+ settings.ROOT_PATH + '../fixtures/initial_data-auth-fr.json',
+ settings.ROOT_PATH + '../ishtar_common/fixtures/initial_data-fr.json',
+ settings.ROOT_PATH +
+ '../ishtar_common/fixtures/initial_spatialrefsystem-fr.json',
+ settings.ROOT_PATH +
+ '../ishtar_common/fixtures/initial_importtypes-fr.json',
+ ]
+
+OPERATION_FIXTURES = COMMON_FIXTURES + [
+ settings.ROOT_PATH +
+ '../archaeological_operations/fixtures/initial_data-fr.json'
+]
+
+
def create_superuser():
username = 'username4277'
password = 'dcbqj756456!@%'
@@ -337,16 +352,7 @@ class AccessControlTest(TestCase):
class AdminGenTypeTest(TestCase):
- fixtures = [settings.ROOT_PATH +
- '../fixtures/initial_data-auth-fr.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_data-fr.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_spatialrefsystem-fr.json',
- settings.ROOT_PATH +
- '../ishtar_common/fixtures/initial_importtypes-fr.json',
- settings.ROOT_PATH +
- '../archaeological_operations/fixtures/initial_data-fr.json']
+ fixtures = OPERATION_FIXTURES
gen_models = [
models.OrganizationType, models.PersonType, models.TitleType,
models.AuthorType, models.SourceType, models.OperationType,
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py
index 3f90f8c48..c5158dfcd 100644
--- a/ishtar_common/wizards.py
+++ b/ishtar_common/wizards.py
@@ -757,6 +757,10 @@ class Wizard(NamedUrlWizardView):
item.skip_history_when_saving = True
item.save()
+ if hasattr(obj, 'fix'):
+ # post save/m2m specific fix
+ obj.fix()
+
# make the new object a default
if self.current_obj_slug:
self.request.session[self.current_obj_slug] = unicode(obj.pk)
diff --git a/version.py b/version.py
index e06be2011..bce04060e 100644
--- a/version.py
+++ b/version.py
@@ -1,4 +1,4 @@
-VERSION = (0, 99, 25)
+VERSION = (0, 99, 26)
def get_version():