[Django] #32108: Allowing null values while registering function on transaction on_commit

9 views
Skip to first unread message

Django

unread,
Oct 14, 2020, 9:08:23 AM10/14/20
to django-...@googlegroups.com
#32108: Allowing null values while registering function on transaction on_commit
-------------------------------------+-------------------------------------
Reporter: S2606 | Owner: nobody
Type: Bug | Status: new
Component: Database | Version: 2.2
layer (models, ORM) | Keywords: DjangoORM
Severity: Normal | Transaction
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
So if I were to try this command:-

`transaction.on_commit(None)`

and run any sample tests which has simple django db post_save signal in
the flow and it has functions which run on transaction commit, the code
would crash with error

`TypeError: 'NoneType' object is not callable`.

So how about if we do not allow it to register as none beforehand or allow
it to exit gracefully?

--
Ticket URL: <https://code.djangoproject.com/ticket/32108>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 18, 2020, 4:29:11 AM10/18/20
to django-...@googlegroups.com
#32108: Allowing null values while registering function on transaction on_commit
-------------------------------------+-------------------------------------
Reporter: Shagun Khemka | Owner: Herbert
Type: | Poul
Cleanup/optimization | Status: assigned
Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: DjangoORM | Triage Stage: Accepted
Transaction |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Herbert Poul):

* owner: nobody => Herbert Poul
* status: new => assigned
* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/13556 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/32108#comment:3>

Django

unread,
Oct 19, 2020, 2:50:19 PM10/19/20
to django-...@googlegroups.com
#32108: Allowing null values while registering function on transaction on_commit
-------------------------------------+-------------------------------------
Reporter: Shagun Khemka | Owner: Herbert
Type: | Poul
Cleanup/optimization | Status: assigned
Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: DjangoORM | Triage Stage: Ready for
Transaction | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/32108#comment:4>

Reply all
Reply to author
Forward
0 new messages