Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#20956 closed Cleanup/optimization (invalid)

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

Reported by: koorgoo 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 Changed 2 years ago by koorgoo

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Created a pull request for this ticket.

Last edited 2 years ago by koorgoo (previous) (diff)

comment:2 Changed 2 years ago by mjtamlyn

  • Triage Stage changed from Unreviewed to Accepted

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

  • Resolution set to fixed
  • Status changed from new to closed

In ce0e86cf761dc182ae6fb8c0d68964955d19ec75:

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

comment:4 Changed 2 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 2 years ago by timo

  • Resolution changed from fixed to invalid

comment:6 Changed 2 years ago by koorgoo

Sorry, guys.
Will be more accurate next time.

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