Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#20956 closed Cleanup/optimization (invalid)

Do not check conn['ENGINE'] existence twice in django.db.utils.ConnectionHandler

Reported by: Dima Kurguzov Owned by: nobody
Component: Database layer (models, ORM) Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no


During code surfing I found a piece of code to optimize.

In this line the conn['ENGINE'] is set to 'django.db.backends.dummy' if it is missed.
In the next line it is checked for existence.

We can remove this check.

Change History (6)

comment:1 Changed 3 years ago by Dima Kurguzov

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

Created a pull request for this ticket.

Last edited 3 years ago by Dima Kurguzov (previous) (diff)

comment:2 Changed 3 years ago by Marc Tamlyn

Triage Stage: UnreviewedAccepted

comment:3 Changed 3 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In ce0e86cf761dc182ae6fb8c0d68964955d19ec75:

Fixed #20956 -- Removed useless check in django.db.utils

comment:4 Changed 3 years ago by Tim Graham <timograham@…>

In 768bbf3efe0c412bced1e865e90139a0f07dc613:

Revert "Fixed #20956 -- Removed useless check in django.db.utils"

This reverts commit ce0e86cf761dc182ae6fb8c0d68964955d19ec75.

The check is necessary if 'ENGINE' is an empty string.
Thanks apollo13 for pointing this out.

comment:5 Changed 3 years ago by Tim Graham

Resolution: fixedinvalid

comment:6 Changed 3 years ago by Dima Kurguzov

Sorry, guys.
Will be more accurate next time.

Note: See TracTickets for help on using tickets.
Back to Top