diff options
-rw-r--r-- | ishtar_common/models.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 14b210ea2..e40c7c54c 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -4712,6 +4712,16 @@ class Document( ) ) + @post_importer_action + def set_main_image(self, __, value): + """ + Post importer action - set the imported image as a main image for associated "value" items + """ + for item in getattr(self, value).all(): + item.main_image = self + item.no_post_process() + item.save() + def get_related_operation_ids(self): operations = list(self.operations.values_list("id", flat=True).all()) operations += list( |