Close the db cursor created for updating the local_id.

Review Request #8713 — Created Feb. 3, 2017 and submitted

Information

Review Board
release-2.0.x
67967ad...

Reviewers

We compute a review request's local_id by running some custom SQL. In doing so,
we create a db cursor, which we weren't closing correctly. Eventually the
garbage collector would get around to it, but we really should be closing it
ourselves.

In Django 1.7, we can avoid this and make it slightly more safe by using the
cursor as a context manager. I've added a TODO comment to track that.

Ran unit tests.

Description From Last Updated

Mind also updating Splat? Pretty sure we do the same sort of thing there.

chipx86chipx86
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/managers.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/managers.py
    
    
  2. 
      
chipx86
  1. 
      
  2. Mind also updating Splat? Pretty sure we do the same sort of thing there.

  3. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.0.x (c35b5e7)
Loading...