@@ -13,6 +13,8 @@ class SearchString(click.ParamType):
1313 name = "search_string"
1414
1515 def convert (self , value , param , ctx ):
16+ value = super ().convert (value , param , ctx )
17+
1618 r = ctx .obj .session .get ("images/search/" , params = {"query" : value , "limit" : 1 })
1719 if r .status_code == 400 and "detail" in r .json () and "query" in r .json ()["detail" ]:
1820 self .fail ('Invalid search query string "%s"' % value , param , ctx )
@@ -23,6 +25,8 @@ class CommaSeparatedIdentifiers(click.ParamType):
2325 name = "comma_separated_identifiers"
2426
2527 def convert (self , value , param , ctx ):
28+ value = super ().convert (value , param , ctx )
29+
2630 if value != "" and not re .match (r"^(\d+)(,\d+)*$" , value ):
2731 self .fail ('Improperly formatted value "%s".' % value , param , ctx )
2832 return value
@@ -36,6 +40,8 @@ def __init__(self, locked_okay: Optional[bool] = False) -> None:
3640 self .locked_okay = locked_okay
3741
3842 def convert (self , value : str , param , ctx ) -> str :
43+ value = super ().convert (value , param , ctx )
44+
3945 try :
4046 collection = get_collection (ctx .obj .session , value )
4147 except HTTPError as e :
@@ -57,6 +63,8 @@ class CohortId(IntParamType):
5763 name = "cohort_id"
5864
5965 def convert (self , value : str , param , ctx ) -> str :
66+ value = super ().convert (value , param , ctx )
67+
6068 try :
6169 get_cohort (ctx .obj .session , value )
6270 except HTTPError as e :
0 commit comments