Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add created_by argument to CeleryResourceMixin #94

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading