Skip to content

Commit

Permalink
LITE-23776 Object is passed to generic_meta_func
Browse files Browse the repository at this point in the history
This is needed for implementation to be able to use model related stuff like META or CQRS_ID and instance, like pk
  • Loading branch information
maxipavlovic committed Jun 2, 2022
1 parent b30f67b commit e331c45
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dj_cqrs/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def get_cqrs_meta(self, **kwargs):
"""
generic_meta_func = settings.CQRS['master']['meta_function']
if generic_meta_func:
return generic_meta_func(**kwargs)
return generic_meta_func(obj=self, **kwargs)

return {}

Expand Down
1 change: 1 addition & 0 deletions tests/test_master/test_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,7 @@ def test_get_cqrs_meta_global_meta_function(mocker, settings):

assert publisher_mock.call_args[0][0].meta == {1: 2}
f.assert_called_once_with(
obj=obj,
instance_data={
'cqrs_revision': 0,
'cqrs_updated': str(obj.cqrs_updated),
Expand Down

0 comments on commit e331c45

Please sign in to comment.