summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoger Hunwicks <roger@tonic-solutions.com>2015-04-22 10:15:11 (GMT)
committerRoger Hunwicks <roger@tonic-solutions.com>2015-04-22 10:15:11 (GMT)
commitb841f322e83bd6356767031b5de4c50987e288a0 (patch)
tree035ed9312ff2e0a44e0c8212a9efb5409dc0ffcd
parent953a0a559afb6c5abf014b9802ddf127c4a64f1c (diff)
downloaddjango-import-export-b841f322e83bd6356767031b5de4c50987e288a0.zip
django-import-export-b841f322e83bd6356767031b5de4c50987e288a0.tar.gz
django-import-export-b841f322e83bd6356767031b5de4c50987e288a0.tar.bz2
Add user to parameters passed from ImportMixin to import_data - see #237
-rw-r--r--import_export/admin.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/import_export/admin.py b/import_export/admin.py
index 49abb0c..13bbd96 100644
--- a/import_export/admin.py
+++ b/import_export/admin.py
@@ -138,7 +138,8 @@ class ImportMixin(ImportExportMixinBase):
result = resource.import_data(dataset, dry_run=False,
raise_errors=True,
- file_name=import_file_name)
+ file_name=import_file_name,
+ user=request.user)
if not self.get_skip_admin_log():
# Add imported objects to LogEntry
@@ -204,7 +205,8 @@ class ImportMixin(ImportExportMixinBase):
dataset = input_format.create_dataset(data)
result = resource.import_data(dataset, dry_run=True,
raise_errors=False,
- file_name=uploaded_file.name)
+ file_name=uploaded_file.name,
+ user=request.user)
context['result'] = result