Merge pull request #1168 from t-ott/prevent-resize-error

prevent IndexError if no GCP files
pull/1175/head
Piero Toffanin 2022-04-18 12:15:19 -04:00 zatwierdzone przez GitHub
commit 691410ef35
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -1074,10 +1074,10 @@ class Task(models.Model):
:return: path to changed GCP file or None if no GCP file was found/changed
"""
gcp_path = self.find_all_files_matching(r'.*\.txt$')
if len(gcp_path) == 0: return None
# Skip geo.txt, image_groups.txt files
gcp_path = list(filter(lambda p: os.path.basename(p).lower() not in ['geo.txt', 'image_groups.txt'], gcp_path))
if len(gcp_path) == 0: return None
# Assume we only have a single GCP file per task
gcp_path = gcp_path[0]