Fix problème lors de l'édition de version sans image
This commit is contained in:
		@@ -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"))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user