Skip to content

Commit

Permalink
Merge pull request #632 from jdufresne/keys
Browse files Browse the repository at this point in the history
Remove unnecessary calls to dict.keys()
  • Loading branch information
bmihelac committed Nov 28, 2017
2 parents 70b29bf + 3b0948f commit 77e20b5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions import_export/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ def clean(self, data):
value = data[self.column_name]
except KeyError:
raise KeyError("Column '%s' not found in dataset. Available "
"columns are: %s" % (self.column_name,
list(data.keys())))
"columns are: %s" % (self.column_name, list(data)))

try:
value = self.widget.clean(value, row=data)
Expand Down
2 changes: 1 addition & 1 deletion import_export/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ def import_data_inner(self, dataset, dry_run, raise_errors, using_transactions,

def get_export_order(self):
order = tuple(self._meta.export_order or ())
return order + tuple(k for k in self.fields.keys() if k not in order)
return order + tuple(k for k in self.fields if k not in order)

def before_export(self, queryset, *args, **kwargs):
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/core/tests/instance_loaders_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def setUp(self):
def test_all_instances(self):
self.assertTrue(self.instance_loader.all_instances)
self.assertEqual(len(self.instance_loader.all_instances), 1)
self.assertEqual(list(self.instance_loader.all_instances.keys()),
self.assertEqual(list(self.instance_loader.all_instances),
[self.book.pk])

def test_get_instance(self):
Expand Down

0 comments on commit 77e20b5

Please sign in to comment.