From c32bb4b69a2015376d514e75dcee2860aac96874 Mon Sep 17 00:00:00 2001 From: Jeremy M Fee <jmfee@usgs.gov> Date: Wed, 25 Nov 2020 17:17:05 +0000 Subject: [PATCH] Remove default values for station/channel/location They are only used if truthy. --- geomagio/api/db/metadata_table.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/geomagio/api/db/metadata_table.py b/geomagio/api/db/metadata_table.py index 6a7c1f172..367e59368 100644 --- a/geomagio/api/db/metadata_table.py +++ b/geomagio/api/db/metadata_table.py @@ -115,11 +115,11 @@ async def get_metadata( if network: query = query.where(metadata.c.network == network) if station: - query = query.where(metadata.c.station.like(station or "%")) + query = query.where(metadata.c.station == station) if channel: - query = query.where(metadata.c.channel.like(channel or "%")) + query = query.where(metadata.c.channel.like(channel)) if location: - query = query.where(metadata.c.location.like(location or "%")) + query = query.where(metadata.c.location.like(location)) if starttime: query = query.where( or_(metadata.c.endtime == None, metadata.c.endtime > starttime) -- GitLab