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

Additional async support for ControllerBase #216

Merged
merged 3 commits into from
Dec 26, 2024

Conversation

le-sun
Copy link
Contributor

@le-sun le-sun commented Dec 18, 2024

Added in async methods for get_object_or_exception and get_object_or_none, which should resolve #215

@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 96.42857% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.71%. Comparing base (a9d5f6f) to head (ff7885f).
Report is 18 commits behind head on master.

Files with missing lines Patch % Lines
ninja_extra/shortcuts.py 94.73% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #216      +/-   ##
==========================================
- Coverage   99.75%   99.71%   -0.04%     
==========================================
  Files          56       56              
  Lines        2458     2491      +33     
==========================================
+ Hits         2452     2484      +32     
- Misses          6        7       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@eadwinCode eadwinCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@le-sun You did an awesome work here. Thanks so much for working on this.

@eadwinCode
Copy link
Owner

@le-sun In your async please skip django version < 4.2

@le-sun
Copy link
Contributor Author

le-sun commented Dec 25, 2024

@le-sun In your async please skip django version < 4.2

Updated

@eadwinCode eadwinCode merged commit bd62762 into eadwinCode:master Dec 26, 2024
23 checks passed
@@ -18,7 +18,7 @@ During the handling of a request, the `has_permission` method is automatically i
in the permission list of the route function. However, `has_object_permission` is not triggered since
it requires an object for permission validation. As a result of that, `has_object_permission` method for permissions are
invoked when attempting to retrieve an object using the `get_object_or_exception`
or `get_object_or_none` methods within the controller.
or `get_object_or_none` methods within the controller. Async versions of these methods are supported with `aget_object_or_exception` and `get_object_or_none`.
Copy link

@lewoudar lewoudar Dec 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is too late for this PR, but there is a typo in the last method name get_object_or_none. I guess the correct name here is aget_object_or_none. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incomplete async support: sync_to_async usage in ModelService
4 participants