-
Notifications
You must be signed in to change notification settings - Fork 10
feat: allow for task service calls from django admin UI #362
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #362 +/- ##
==========================================
- Coverage 94.30% 94.12% -0.18%
==========================================
Files 1247 1248 +1
Lines 45847 45969 +122
Branches 1455 1455
==========================================
+ Hits 43237 43270 +33
- Misses 2305 2394 +89
Partials 305 305
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
ElioDiNino
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See compose comments
we want to be able to call task service methods from the django admin UI so it's easier to debug customer issues
a1bc56f to
838fd62
Compare
| extra={ | ||
| "task_method": task_method, | ||
| "method_kwargs": method_kwargs, | ||
| "error": str(e), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential bug: Undefined variables `task_method`, `method_kwargs` in `except` block cause `NameError` and admin crash.
- Description: The
submit_task_viewfunction attempts to logtask_methodandmethod_kwargswithin itsexceptblock. Ifform.call_task_method()on line 170 raises an exception (e.g., a Celery broker connection error or serialization error not caught bycall_task_method's internalexceptblock), thentask_methodandmethod_kwargs(assigned on lines 171-172) will not have been defined. This leads to aNameErrorduring logging, masking the original issue and causing the admin interface to crash, hindering debugging. - Suggested fix: Ensure
task_methodandmethod_kwargsare defined beforeform.call_task_method()or access them directly fromform.cleaned_datawithin theexceptblock.
severity: 0.95, confidence: 0.98
Did we get this right? 👍 / 👎 to inform future reviews.
ElioDiNino
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.


we want to be able to call task service methods from the django admin UI so it's easier to debug customer issues