diff options
| 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 | 
| commit | a3d5d9af116354f8961630e46b57063c534da515 (patch) | |
| tree | 243808644e7f1b9246b6792b65bce84679716c10 /archaeological_operations/models.py | |
| parent | b8f1e3556ed90a07053633d2681eb79094b79aa3 (diff) | |
| download | Ishtar-a3d5d9af116354f8961630e46b57063c534da515.tar.bz2 Ishtar-a3d5d9af116354f8961630e46b57063c534da515.zip  | |
Parcel merging temporary disabled
Diffstat (limited to 'archaeological_operations/models.py')
| -rw-r--r-- | archaeological_operations/models.py | 7 | 
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:  | 
