Fix error when not-existing import job is submitted.

This commit is contained in:
James Cole 2017-02-26 11:48:38 +01:00
parent 2116486fe0
commit b23eb07018
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
2 changed files with 4 additions and 1 deletions

View File

@ -84,7 +84,7 @@ class CreateImport extends Command
$job = $jobRepository->create($type);
$this->line(sprintf('Created job "%s"...', $job->key));
Artisan::call('firefly:encrypt', ['file' => $file, 'key' => $job->key]);
Artisan::call('firefly:encrypt-file', ['file' => $file, 'key' => $job->key]);
$this->line('Stored import data...');
$job->configuration = $configurationData;

View File

@ -59,6 +59,9 @@ class Import extends Command
Log::debug('Start start-import command');
$jobKey = $this->argument('key');
$job = ImportJob::whereKey($jobKey)->first();
if (is_null($job)) {
$this->error(sprintf('No job found with key "%s"', $jobKey));
}
if (!$this->isValid($job)) {
Log::error('Job is not valid for some reason. Exit.');