Fix element name conflict
This commit is contained in:
@@ -26,7 +26,7 @@ def upload_file(_step, file_name):
|
||||
#uploading the file itself
|
||||
path = os.path.join(TEST_ROOT, 'uploads/', file_name)
|
||||
world.browser.execute_script("$('input.file-input').css('display', 'block')")
|
||||
world.browser.attach_file('files[]', os.path.abspath(path))
|
||||
world.browser.attach_file('file', os.path.abspath(path))
|
||||
close_css = 'a.close-button'
|
||||
world.css_click(close_css)
|
||||
|
||||
@@ -43,7 +43,7 @@ def upload_file(_step, files_string):
|
||||
for f in files:
|
||||
path = os.path.join(TEST_ROOT, 'uploads/', f)
|
||||
world.browser.execute_script("$('input.file-input').css('display', 'block')")
|
||||
world.browser.attach_file('files[]', os.path.abspath(path))
|
||||
world.browser.attach_file('file', os.path.abspath(path))
|
||||
close_css = 'a.close-button'
|
||||
world.css_click(close_css)
|
||||
|
||||
|
||||
@@ -149,14 +149,14 @@ def upload_asset(request, org, course, coursename):
|
||||
logging.error('Could not find course' + location)
|
||||
return HttpResponseBadRequest()
|
||||
|
||||
if 'files[]' not in request.FILES:
|
||||
if 'file' not in request.FILES:
|
||||
return HttpResponseBadRequest()
|
||||
|
||||
# compute a 'filename' which is similar to the location formatting, we're
|
||||
# using the 'filename' nomenclature since we're using a FileSystem paradigm
|
||||
# here. We're just imposing the Location string formatting expectations to
|
||||
# keep things a bit more consistent
|
||||
upload_file = request.FILES['files[]']
|
||||
upload_file = request.FILES['file']
|
||||
filename = upload_file.name
|
||||
mime_type = upload_file.content_type
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
<form class="file-chooser" action="${upload_asset_callback_url}"
|
||||
method="post" enctype="multipart/form-data">
|
||||
<a href="#" class="choose-file-button">${_("Choose File")}</a>
|
||||
<input type="file" class="file-input" name="files[]" multiple>
|
||||
<input type="file" class="file-input" name="file" multiple>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user