From 043373c0ef508cf844df85088c350f6eb72c75e4 Mon Sep 17 00:00:00 2001 From: quimmrc Date: Wed, 18 Dec 2024 10:01:21 +0100 Subject: [PATCH] improve variable naming --- accounts/views.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/accounts/views.py b/accounts/views.py index 8b6a15bd7..42d158f71 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -1284,17 +1284,17 @@ def upload(request, no_flash=False): form = UploadFileForm(request.POST, request.FILES) if form.is_valid(): submitted_files = request.FILES.getlist('files') - files_names = list() + duplicated_filenames = list() for file_ in submitted_files: #check for duplicated names and add an identifier, otherwise, different files with the same #name will be overwritten in the description queue - if file_.name in files_names: - name_counter = files_names.count(file_.name) - files_names.append(file_.name) + if file_.name in duplicated_filenames: + name_counter = duplicated_filenames.count(file_.name) + duplicated_filenames.append(file_.name) name, extension = os.path.splitext(file_.name) file_.name = "%s(%d)%s" % (name, name_counter, extension) else: - files_names.append(file_.name) + duplicated_filenames.append(file_.name) if handle_uploaded_file(request.user.id, file_): uploaded_file = file_