summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-07-07 13:56:12 +0200
committerÉtienne Loks <etienne.loks@proxience.com>2015-07-07 13:56:12 +0200
commit9731cd9dc5e1dbfee167d99e1d0b4403916cb0ef (patch)
tree243808644e7f1b9246b6792b65bce84679716c10
parentf23b90837a4ac5b6a2166e8fcad6d5f263aea841 (diff)
downloadIshtar-9731cd9dc5e1dbfee167d99e1d0b4403916cb0ef.tar.bz2
Ishtar-9731cd9dc5e1dbfee167d99e1d0b4403916cb0ef.zip
Parcel merging temporary disabled
-rw-r--r--archaeological_operations/models.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index 696f4d685..6e74f2c44 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -429,6 +429,7 @@ class Operation(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,
if self.start_date and not self.year:
self.year = self.start_date.year
# manage parcel association
+ """
if FILES_AVAILABLE and self.associated_file:
for parcel in self.associated_file.parcels.exclude(
operation=self).all():
@@ -445,7 +446,7 @@ class Operation(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,
parcel.merge(parcels[keys])
else:
parcels[keys] = parcel
-
+ """
return super(Operation, self).save(*args, **kwargs)
m2m_changed.connect(cached_label_changed, sender=Operation.towns.through)
@@ -792,9 +793,11 @@ def parcel_post_save(sender, **kwargs):
parcel.external_id = (parcel.section or "") + (parcel.parcel_number or "")
parcel.save()
return
- if parcel.operation and parcel.town not in list(parcel.operation.towns.all()):
+ if parcel.operation and parcel.operation.pk and \
+ parcel.town not in list(parcel.operation.towns.all()):
parcel.operation.towns.add(parcel.town)
if FILES_AVAILABLE and parcel.associated_file and \
+ parcel.associated_file.pk and \
parcel.town not in list(parcel.associated_file.towns.all()):
parcel.associated_file.towns.add(parcel.town)
if not FILES_AVAILABLE: