From d47c13c11f4fa585e123ed5fccb9bc865c9659c5 Mon Sep 17 00:00:00 2001 From: Ricky Elrod Date: May 27 2017 00:11:53 +0000 Subject: commit instead of flush on issue assign update 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 --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index d10f775..f32426d 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -498,7 +498,7 @@ def add_issue_assignee(session, issue, assignee, user, ticketfolder, 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)