fix uploads
This commit is contained in:
parent
4eccf28b83
commit
4cb2dc8131
|
@ -60,7 +60,11 @@ def add_folder(request):
|
||||||
category.save()
|
category.save()
|
||||||
user = request.user
|
user = request.user
|
||||||
# import pdb;pdb.set_trace()
|
# import pdb;pdb.set_trace()
|
||||||
shutil.move(join(FTP_ROOT, folder_name), join(UPLOAD_ROOT, folder_name))
|
n = 1
|
||||||
|
while os.path.exists(join(UPLOAD_ROOT, folder_name)):
|
||||||
|
n += 1
|
||||||
|
folder_name = u'%s (%s)' % (form.cleaned_data['folder_name'], n)
|
||||||
|
shutil.move(join(FTP_ROOT, folder_name), UPLOAD_ROOT)
|
||||||
File.addFiles(category, user, folder_name)
|
File.addFiles(category, user, folder_name)
|
||||||
return render_to_response("files/added_folder.html", {
|
return render_to_response("files/added_folder.html", {
|
||||||
'folder_name': folder_name,
|
'folder_name': folder_name,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user