Opened 11 years ago

Closed 11 years ago

Last modified 11 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

Description

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 by Dima Kurguzov, 11 years ago

Created a pull request for this ticket.

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

comment:2 by Marc Tamlyn, 11 years ago

Triage Stage: UnreviewedAccepted

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

Resolution: fixed
Status: newclosed

In ce0e86cf761dc182ae6fb8c0d68964955d19ec75:

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

comment:4 by Tim Graham <timograham@…>, 11 years ago

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 by Tim Graham, 11 years ago

Resolution: fixedinvalid

comment:6 by Dima Kurguzov, 11 years ago

Sorry, guys.
Will be more accurate next time.

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