Skip to content

Commit a0e2689

Browse files
author
Jairus Martin
committed
Made it make a copy if the data is not mutable
1 parent 3a4a1f0 commit a0e2689

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

xadmin/plugins/auth.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ def get_field_attrs(self, __, db_field, **kwargs):
130130

131131
def get_form_datas(self, datas):
132132
if self.user_fields and 'data' in datas:
133+
if hasattr(datas['data'],'_mutable') and not datas['data']._mutable:
134+
datas['data'] = datas['data'].copy()
133135
for f in self.user_fields:
134136
datas['data'][f] = self.user.id
135137
return datas

0 commit comments

Comments
 (0)