@@ -86,11 +86,11 @@ def get_signature(cls, parameters):
86
86
tasks_core .crop .signature (
87
87
kwargs = {'bounding_box' : parameters .get ('bounding_box' , None )}),
88
88
])
89
-
90
- tasks .extend ([
91
- tasks_core .archive .signature (),
92
- tasks_core .publish .signature (),
93
- ])
89
+ if parameters . get ( 'publish' , False ):
90
+ tasks .extend ([
91
+ tasks_core .archive .signature (),
92
+ tasks_core .publish .signature (),
93
+ ])
94
94
return celery .chain (tasks )
95
95
96
96
@staticmethod
@@ -100,7 +100,7 @@ def check_parameters(parameters):
100
100
- dataset_id: integer
101
101
- bounding_box: 4-elements list
102
102
"""
103
- if not set (parameters ).issubset (set (('dataset_id' , 'bounding_box' ))):
103
+ if not set (parameters ).issubset (set (('dataset_id' , 'bounding_box' , 'publish' ))):
104
104
raise ValidationError ("The download action accepts only one parameter: 'dataset_id'" )
105
105
if not isinstance (parameters ['dataset_id' ], int ):
106
106
raise ValidationError ("'dataset_id' must be an integer" )
@@ -109,6 +109,8 @@ def check_parameters(parameters):
109
109
len (parameters ['bounding_box' ]) == 4 )):
110
110
raise ValidationError ("'bounding_box' must be a sequence in the following format: "
111
111
"west, north, east, south" )
112
+ if ('publish' in parameters and not isinstance (parameters ['publish' ], bool )):
113
+ raise ValidationError ("'publish' must be a boolean" )
112
114
return parameters
113
115
114
116
@staticmethod
0 commit comments