Skip to content
Snippets Groups Projects
Commit 38b8eff4 authored by Vermaat's avatar Vermaat
Browse files

Fix bug in transcript-protein link query

parent 45f7d276
No related branches found
No related tags found
No related merge requests found
...@@ -87,17 +87,13 @@ def get_transcript_protein_link(accession, reverse=False): ...@@ -87,17 +87,13 @@ def get_transcript_protein_link(accession, reverse=False):
# Lookup by protein accession instead of transcript accession. # Lookup by protein accession instead of transcript accession.
query_column, other_column = other_column, query_column query_column, other_column = other_column, query_column
return TranscriptProteinLink.query \ return TranscriptProteinLink.query.filter(
.filter_by(transcript_accession=accession) \ query_column == accession,
.filter( or_(and_(other_column.isnot(None),
query_column == accession, TranscriptProteinLink.added >= link_datetime),
or_( and_(other_column.is_(None),
and_(other_column.isnot(None), TranscriptProteinLink.added >= negative_link_datetime))
TranscriptProteinLink.added >= link_datetime), ).first()
and_(other_column.is_(None),
TranscriptProteinLink.added >= negative_link_datetime))
) \
.first()
def update_transcript_protein_link(transcript_accession=None, def update_transcript_protein_link(transcript_accession=None,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment