Add kwargs to import_row, import_object and import_field #1190
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added in resources.py kwargs on def import_row line 506, def import_object line 359 and def import_field line 348. Because I need the user id of the reqisition that is in kwargs, on import_field def. I need this user to filter objects by my permission system on a manager of the class.
Signed-off-by: GabrielPetz gabriel.petz.simepar@gmail.com
Problem
I have a customized permission system to different users, so I need them id before import fields, in my case I need subscribe this method import_field, adding the user of request.
Solution
How did you solve the problem?
The solution for my problem has been adding in resources.py argument kwargs on functions import_row line 506, import_object line 359 and import_field line 348
Acceptance Criteria
There is no need to write a different test, the test_resource.py file already calls the import_data > import_data_inner > import_row > import_obj > import_field , then the class of tests already coverage the changes. My changes are in bold.
There is no need to screenshots, because my changes are just in resources.py, there is no other changes.
I just added kwargs argument on functions, so there is no need to docs in function body to describe it.