On ne supprime pas les dupliqués même s'ils sont dans le même import
This commit is contained in:
parent
583679b546
commit
56ae9a06e9
@ -1481,12 +1481,15 @@ class Event(models.Model):
|
||||
# check if we need to clean the other_versions
|
||||
if (
|
||||
not clone
|
||||
and not "noclean_other_versions" in kwargs
|
||||
and self.pk
|
||||
and self.other_versions is not None
|
||||
and self.other_versions.nb_duplicated() == 1
|
||||
):
|
||||
self.other_versions.delete()
|
||||
self.other_versions = None
|
||||
if "noclean_other_versions" in kwargs:
|
||||
del kwargs["noclean_other_versions"]
|
||||
|
||||
# first save the current object
|
||||
super().save(*args, **kwargs)
|
||||
@ -2042,7 +2045,7 @@ class Event(models.Model):
|
||||
or new_image
|
||||
):
|
||||
same_imported.download_image()
|
||||
same_imported.save(update_fields=["local_image"])
|
||||
same_imported.save(update_fields=["local_image"], noclean_other_versions=True)
|
||||
|
||||
to_update.append(same_imported)
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user