Fixing job binary creation from existing file

Fixing the ability to create a data processing job
binary from an file that already exists in the internal
database.

Change-Id: I1ba065958b2987059c5faeb1182ddb01c721f907
Closes-Bug: #1427289
This commit is contained in:
Chad Roberts 2015-03-02 14:46:37 -05:00
parent f15f76bee8
commit 5b662df474

View File

@ -210,6 +210,7 @@ class JobBinaryCreateForm(forms.SelfHandlingForm):
self.get_unique_binary_name(
request, request.FILES["job_binary_file"].name),
request.FILES["job_binary_file"].read())
bin_id = result.id
except Exception:
exceptions.handle(request,
_("Unable to upload job binary"))
@ -221,12 +222,12 @@ class JobBinaryCreateForm(forms.SelfHandlingForm):
self.get_unique_binary_name(
request, context["job_binary_script_name"]),
context["job_binary_script"])
bin_id = result.id
except Exception:
exceptions.handle(request,
_("Unable to create job binary"))
return None
bin_id = result.id
return "internal-db://%s" % bin_id
def handle_swift(self, request, context):