Skip to content
Snippets Groups Projects
Commit 62e0f3f8 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[algorithms][admin] Fixed editing

parent 3e5eb07f
No related branches found
No related tags found
1 merge request!2551.4.x
......@@ -125,10 +125,11 @@ class AlgorithmModelForm(forms.ModelForm):
def clean(self):
"""Cleans-up the input data, make sure it overall validates"""
# make sure we don't pass back a str field as 'file'
if 'declaration_file' in self.data and \
isinstance(self.data['declaration_file'], six.string_types):
self.data['declaration_file'] = ContentFile(self.data['declaration_file'], name='unsaved')
mutable_data = self.data.copy()
mutable_data['declaration_file'] = ContentFile(self.data['declaration_file'], name='unsaved')
self.data = mutable_data
#----------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment