From 62e0f3f8b9857a4d77941fa96041030ee3cc87e9 Mon Sep 17 00:00:00 2001
From: Samuel Gaist <samuel.gaist@idiap.ch>
Date: Thu, 4 Oct 2018 15:18:26 +0200
Subject: [PATCH] [algorithms][admin] Fixed editing

---
 beat/web/algorithms/admin.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/beat/web/algorithms/admin.py b/beat/web/algorithms/admin.py
index 74f2f140f..650ff196e 100755
--- a/beat/web/algorithms/admin.py
+++ b/beat/web/algorithms/admin.py
@@ -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
 
 
 #----------------------------------------------------------
-- 
GitLab