瀏覽代碼

Fix archiving locations not respecting the dry run flag

Alan Lam 9 月之前
父節點
當前提交
df6414b4fa
共有 1 個文件被更改,包括 5 次插入 和 1 次删除
  1. 5 1
      tasks/import_venues.php

+ 5 - 1
tasks/import_venues.php

@@ -343,8 +343,12 @@ for($i = 0; $data = fgetcsv($handle); $i++) {
 if($archive_missing) {
 	foreach($missing_locations as $missing_location) {
 		echo sprintf("Location#%s - %s archived.\n", $missing_location->id, $missing_location->name);
+
 		$missing_location->archived = 1;
-		$missing_location->commit();
+
+		if(!$dry_run) {
+			$missing_location->commit();
+		}
 	}
 }