summaryrefslogtreecommitdiff
path: root/archaeological_finds/models_treatments.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne@peacefrogs.net>2019-02-06 14:41:19 +0100
committerÉtienne Loks <etienne@peacefrogs.net>2019-02-06 14:45:08 +0100
commit4cbb3429c3243e93597c2d2fbc668b444499c728 (patch)
tree873f1337aa01cfe97d6d5a0d8cb1ceb6c27408b6 /archaeological_finds/models_treatments.py
parentfa7c887d6321601219912e2be3395dfc6e415518 (diff)
downloadIshtar-4cbb3429c3243e93597c2d2fbc668b444499c728.tar.bz2
Ishtar-4cbb3429c3243e93597c2d2fbc668b444499c728.zip
Main image: fix bad "on_delete" behaviour
Diffstat (limited to 'archaeological_finds/models_treatments.py')
-rw-r--r--archaeological_finds/models_treatments.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py
index 7d9b8ebb6..a1e0a0437 100644
--- a/archaeological_finds/models_treatments.py
+++ b/archaeological_finds/models_treatments.py
@@ -181,6 +181,7 @@ class Treatment(DashboardFormItem, ValueGetter, BaseHistorizedItem,
blank=True)
main_image = models.ForeignKey(
Document, related_name='main_image_treatments',
+ on_delete=models.SET_NULL,
verbose_name=_(u"Main image"), blank=True, null=True)
cached_label = models.TextField(_(u"Cached name"), null=True, blank=True,
db_index=True)
@@ -934,6 +935,7 @@ class TreatmentFile(DashboardFormItem, ClosedItem, BaseHistorizedItem,
blank=True)
main_image = models.ForeignKey(
Document, related_name='main_image_treatment_files',
+ on_delete=models.SET_NULL,
verbose_name=_(u"Main image"), blank=True, null=True)
associated_basket = models.ForeignKey(
FindBasket, null=True, blank=True, on_delete=models.SET_NULL,