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

[plotters][admin] Fix immutable query object modification error

Work now on copy of QueryObject as recommended in the Django
documentation and replace the original with the copy
parent f9e3aecc
No related branches found
No related tags found
2 merge requests!2551.4.x,!249Web fixes
......@@ -27,11 +27,10 @@
'''Administrative add-on for the extended Django User model'''
import six
from django.contrib import admin
from django import forms
from django.core.files.base import ContentFile
from django.utils import six
from ..common.texts import Messages
......@@ -134,7 +133,9 @@ class PlotterModelForm(forms.ModelForm):
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