File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -504,6 +504,9 @@ def copy_raster_file(
504
504
505
505
original_dataset = original_dataset .first ()
506
506
507
+ if not original_dataset .files :
508
+ raise InvalidGeoTiffException ("The original file of the dataset is not available, Is not possible to copy the dataset" )
509
+
507
510
new_file_location = orchestrator .load_handler (handler_module_path ).copy_original_file (original_dataset )
508
511
509
512
new_dataset_alternate = create_alternate (original_dataset .title , exec_id )
Original file line number Diff line number Diff line change @@ -10,7 +10,13 @@ def dataset_migration(apps, _):
10
10
.exclude (pk__in = NewResources .objects .values_list ('resource_id' , flat = True ))\
11
11
.exclude (subtype__in = ['remote' , None ]):
12
12
# generating orchestrator expected data file
13
- converted_files = [{"base_file" : x } for x in old_resource .files ]
13
+ if not old_resource .files :
14
+ if old_resource .is_vector ():
15
+ converted_files = [{"base_file" : "placeholder.shp" }]
16
+ else :
17
+ converted_files = [{"base_file" : "placeholder.tiff" }]
18
+ else :
19
+ converted_files = [{"base_file" : x } for x in old_resource .files ]
14
20
# try to get the handler for the file of the old resource
15
21
# when is found, we can exit
16
22
handler_to_use = None
You can’t perform that action at this time.
0 commit comments