Commit 0acaaa88 by Julian Arni

Fix element name conflict

parent 0734d835
...@@ -26,7 +26,7 @@ def upload_file(_step, file_name): ...@@ -26,7 +26,7 @@ def upload_file(_step, file_name):
#uploading the file itself #uploading the file itself
path = os.path.join(TEST_ROOT, 'uploads/', file_name) path = os.path.join(TEST_ROOT, 'uploads/', file_name)
world.browser.execute_script("$('input.file-input').css('display', 'block')") 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' close_css = 'a.close-button'
world.css_click(close_css) world.css_click(close_css)
...@@ -43,7 +43,7 @@ def upload_file(_step, files_string): ...@@ -43,7 +43,7 @@ def upload_file(_step, files_string):
for f in files: for f in files:
path = os.path.join(TEST_ROOT, 'uploads/', f) path = os.path.join(TEST_ROOT, 'uploads/', f)
world.browser.execute_script("$('input.file-input').css('display', 'block')") 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' close_css = 'a.close-button'
world.css_click(close_css) world.css_click(close_css)
......
...@@ -149,14 +149,14 @@ def upload_asset(request, org, course, coursename): ...@@ -149,14 +149,14 @@ def upload_asset(request, org, course, coursename):
logging.error('Could not find course' + location) logging.error('Could not find course' + location)
return HttpResponseBadRequest() return HttpResponseBadRequest()
if 'files[]' not in request.FILES: if 'file' not in request.FILES:
return HttpResponseBadRequest() return HttpResponseBadRequest()
# compute a 'filename' which is similar to the location formatting, we're # compute a 'filename' which is similar to the location formatting, we're
# using the 'filename' nomenclature since we're using a FileSystem paradigm # using the 'filename' nomenclature since we're using a FileSystem paradigm
# here. We're just imposing the Location string formatting expectations to # here. We're just imposing the Location string formatting expectations to
# keep things a bit more consistent # keep things a bit more consistent
upload_file = request.FILES['files[]'] upload_file = request.FILES['file']
filename = upload_file.name filename = upload_file.name
mime_type = upload_file.content_type mime_type = upload_file.content_type
......
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
<form class="file-chooser" action="${upload_asset_callback_url}" <form class="file-chooser" action="${upload_asset_callback_url}"
method="post" enctype="multipart/form-data"> method="post" enctype="multipart/form-data">
<a href="#" class="choose-file-button">${_("Choose File")}</a> <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> </form>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment