Skip to content

Commit

Permalink
Changing the join table mapping on the instrument association lookup …
Browse files Browse the repository at this point in the history
…by project to use TransSIP instead of ProjectInstrument as it's more representative of reality in the metadata server (#278)
  • Loading branch information
dmlb2000 committed Mar 5, 2020
1 parent 36cd530 commit c5095f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pacifica/metadata/rest/project_queries/project_lookup.py
Expand Up @@ -5,7 +5,7 @@
import cherrypy
from cherrypy import tools, HTTPError
from peewee import DoesNotExist
from pacifica.metadata.orm import Projects, Instruments, ProjectInstrument
from pacifica.metadata.orm import Projects, Instruments, TransSIP
from pacifica.metadata.rest.project_queries.query_base import QueryBase
from pacifica.metadata.orm.base import db_connection_decorator

Expand All @@ -31,7 +31,7 @@ def _get_project_details(project_id):
project_id)
raise HTTPError('404 Not Found', message)

proj_inst = ProjectInstrument()
proj_inst = TransSIP()
pi_where_clause = proj_inst.where_clause(
{'project_id': project_id})
instrument_entries = (Instruments
Expand All @@ -41,7 +41,7 @@ def _get_project_details(project_id):
Instruments.active
)
.order_by(Instruments.id)
.join(ProjectInstrument)
.join(TransSIP)
.where(pi_where_clause))
instruments = {i.id: {
'id': i.id,
Expand Down

0 comments on commit c5095f7

Please sign in to comment.