From 12b925017284b2708ad19c99226eeb3b346cd8fb Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 27 2017 21:11:43 +0000 Subject: Fix ordering the issues by author or assignee The solution we had was relying on code added in sqlalchemy 1.0.0 while this is newer than the sqlalchemy version in production. This falls back to older (but also working) code. Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 17ccbed..9ee286c 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -2551,14 +2551,14 @@ def search_issues( # We must do a LEFT JOIN on model.Issue.assignee because there are # two foreign keys on model.Issue tied to model.User. This tells # SQLAlchemy which foreign key on model.User to order on. - query = query.join(model.User, model.Issue.assignee, isouter=True) + query = query.outerjoin(model.User, model.Issue.assignee) column = model.User.user # If we are ordering by user, then order by reporters' usernames elif order_key == 'user': # We must do a LEFT JOIN on model.Issue.user because there are # two foreign keys on model.Issue tied to model.User. This tells # SQLAlchemy which foreign key on model.User to order on. - query = query.join(model.User, model.Issue.user, isouter=True) + query = query.outerjoin(model.User, model.Issue.user) column = model.User.user elif order_key in model.Issue.__table__.columns.keys(): column = getattr(model.Issue, order_key)