diff --git a/mutalyzer/db/queries.py b/mutalyzer/db/queries.py index ab4e814e5718737c46fac971d066b65e6c5206cc..d457b60c1d60f9774991ed703528c2b15cb34a8c 100644 --- a/mutalyzer/db/queries.py +++ b/mutalyzer/db/queries.py @@ -87,17 +87,13 @@ def get_transcript_protein_link(accession, reverse=False): # Lookup by protein accession instead of transcript accession. query_column, other_column = other_column, query_column - return TranscriptProteinLink.query \ - .filter_by(transcript_accession=accession) \ - .filter( - query_column == accession, - or_( - and_(other_column.isnot(None), - TranscriptProteinLink.added >= link_datetime), - and_(other_column.is_(None), - TranscriptProteinLink.added >= negative_link_datetime)) - ) \ - .first() + return TranscriptProteinLink.query.filter( + query_column == accession, + or_(and_(other_column.isnot(None), + TranscriptProteinLink.added >= link_datetime), + and_(other_column.is_(None), + TranscriptProteinLink.added >= negative_link_datetime)) + ).first() def update_transcript_protein_link(transcript_accession=None,