#2316 commit instead of flush on issue assign update
Merged 6 years ago by pingou. Opened 6 years ago by codeblock.

file modified
+1 -1
@@ -498,7 +498,7 @@ 

      if issue.assignee_id != assignee_obj.id:

          issue.assignee_id = assignee_obj.id

          session.add(issue)

-         session.flush()

+         session.commit()

          pagure.lib.git.update_git(

              issue, repo=issue.project, repofolder=ticketfolder)

  

Like it does earlier in the file, when resetting the assignee. If we
don't commit the transaction, SA won't let us access the updated
attributes, which is why we were (correctly) getting None in the reset
case (since it calls commit), but we were getting the old assignee in
the reassign case.

This fixes #1896.

Signed-off-by: Ricky Elrod ricky@elrod.me

Pull-Request has been merged by pingou

6 years ago