#36487: Database on commit error logging fails for partials
-------------------------------------+-------------------------------------
     Reporter:  Krishnaprasad MG     |                    Owner:
                                     |  Krishnaprasad MG
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  5.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Krishnaprasad MG):

 This also can be done, the current fix effectively prints the wrapped
 function name in case of partial, but yes may be this is fine (copied from
 the tests)

 `def robust_callback():`
 `  raise ForcedError("robust callback")`

 `robust_callback_partial = partial(robust_callback)`

 `>>> getattr(robust_callback_partial, "__qualname__",
 robust_callback_partial)`
 `functools.partial(<function robust_callback at 0x101287600>)`
 `>>> getattr(robust_callback, "__qualname__", robust_callback)`
 `'robust_callback'`

 I could update the PR
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36487#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/01070197c68b8a7f-9fd2ca58-fed5-4d72-8489-b63b2ceaaf40-000000%40eu-central-1.amazonses.com.

Reply via email to