Skip to content

Commit

Permalink
Add created_by argument to CeleryResourceMixin
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSuperiorStanislav committed Jan 14, 2025
1 parent 2289621 commit 2e2f0f7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
History
=======

UNRELEASED
------------------

* Add explicit `created_by` argument to `CeleryResourceMixin` and pass it in
`ExportJobSerializer` validation

1.3.1 (2025-01-13)
------------------

Expand Down
1 change: 1 addition & 0 deletions import_export_extensions/api/serializers/export_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def validate(self, attrs: dict[str, typing.Any]) -> dict[str, typing.Any]:
self.resource_class(
ordering=self._ordering,
filter_kwargs=self._filter_kwargs,
created_by=self._user,
**self._resource_kwargs,
).get_queryset()
return attrs
Expand Down
2 changes: 2 additions & 0 deletions import_export_extensions/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ def __init__(
self,
filter_kwargs: dict[str, typing.Any] | None = None,
ordering: collections.abc.Sequence[str] | None = None,
created_by: typing.Any | None = None,
**kwargs,
):
"""Remember init kwargs."""
self._filter_kwargs = filter_kwargs
self._ordering = ordering
self._created_by = created_by
self.resource_init_kwargs: dict[str, typing.Any] = kwargs
self.total_objects_count = 0
self.current_object_number = 0
Expand Down

0 comments on commit 2e2f0f7

Please sign in to comment.