Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 785a3a3

Browse files
author
Greg Turner
committed
Protect Artwork from deletion if it still has images.
1 parent 96a420d commit 785a3a3

File tree

1 file changed

+1
-1
lines changed
  • collectionkit/contrib/work_creator/models

1 file changed

+1
-1
lines changed

collectionkit/contrib/work_creator/models/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def order_by_view(self):
6464

6565
class WorkImageBase(models.Model):
6666

67-
artwork = models.ForeignKey('collection.Artwork', related_name='images')
67+
artwork = models.ForeignKey('collection.Artwork', related_name='images', on_delete=models.PROTECT)
6868

6969
order = models.PositiveIntegerField(null=True, blank=True)
7070

0 commit comments

Comments
 (0)