From 6fbb17453b95627a636d6973e44b840d335ac4b4 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 23 Jan 2017 10:08:37 +0100 Subject: Operations: fix deletion of sym-linked operations --- ishtar_common/models.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index d58d549c8..0bc0a607d 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -959,11 +959,12 @@ def post_delete_record_relation(sender, instance, **kwargs): # no symetric/inverse is defined if not sym_rel_type: return - - dct = {'right_record': instance.left_record, - 'left_record': instance.right_record, + dct = {'right_record_id': instance.left_record_id, + 'left_record_id': instance.right_record_id, 'relation_type': sym_rel_type} - instance.__class__.objects.filter(**dct).delete() + q = instance.__class__.objects.filter(**dct) + if q.count(): + q.delete() class ShortMenuItem(object): -- cgit v1.2.3 From ba6e9a1a6d02d031e7d2e605a894139f1d6c69d2 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 23 Jan 2017 20:01:36 +0100 Subject: Import: add types --- ishtar_common/models.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 0bc0a607d..d1d58f184 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -2049,10 +2049,13 @@ TARGET_MODELS = [ _(u"Conservatory state")), ('archaeological_finds.models.PreservationType', _(u"Preservation type")), ('archaeological_finds.models.ObjectType', _(u"Object type")), + ('archaeological_finds.models.IntegrityType', _(u"Integrity type")), + ('archaeological_finds.models.RemarkabilityType', _(u"Remarkability type")), ('archaeological_context_records.models.IdentificationType', _("Identification type")), ('archaeological_context_records.models.RelationType', _(u"Context record relation type")), + ('SpatialReferenceSystem', _(u"Spatial reference system")), ('SupportType', _(u"Support type")), ] -- cgit v1.2.3