diff --git a/src/agenda_culturel/forms.py b/src/agenda_culturel/forms.py index b2f19d0..38607b9 100644 --- a/src/agenda_culturel/forms.py +++ b/src/agenda_culturel/forms.py @@ -154,7 +154,9 @@ class EventForm(ModelForm): super().clean() # when cloning an existing event, we need to copy the local image - if self.cleaned_data['local_image'] is None and not self.cleaned_data['old_local_image'] is None: + if self.cleaned_data['local_image'] is None and \ + not self.cleaned_data['old_local_image'] is None and \ + self.cleaned_data['old_local_image'] != "": basename = self.cleaned_data['old_local_image'] old = settings.MEDIA_ROOT + "/" + basename self.cleaned_data['local_image'] = File(name=basename, file=open(old, "rb"))