Browse Source

Simplifies 'all files on disk' var names

Adrien Panay 7 years ago
parent
commit
3ec5804b06
1 changed files with 9 additions and 9 deletions
  1. 9 9
      tracim/migration/versions/913efdf409e5_all_files_also_on_disk.py

+ 9 - 9
tracim/migration/versions/913efdf409e5_all_files_also_on_disk.py View File

@@ -62,20 +62,20 @@ def upgrade():
62 62
     select_query = revision_helper.select() \
63 63
         .where(revision_helper.c.type == 'file') \
64 64
         .where(revision_helper.c.depot_file.is_(None))
65
-    all_files = connection.execute(select_query).fetchall()
66
-    for one_file in all_files:
67
-        one_file_filename = '{0}{1}'.format(
68
-            one_file.label,
69
-            one_file.file_extension,
65
+    files = connection.execute(select_query).fetchall()
66
+    for file in files:
67
+        file_filename = '{0}{1}'.format(
68
+            file.label,
69
+            file.file_extension,
70 70
         )
71 71
         depot_file_intent = FileIntent(
72
-            one_file.file_content,
73
-            one_file_filename,
74
-            one_file.file_mimetype,
72
+            file.file_content,
73
+            file_filename,
74
+            file.file_mimetype,
75 75
         )
76 76
         depot_file_field = UploadedFile(depot_file_intent, 'tracim')
77 77
         update_query = revision_helper.update() \
78
-            .where(revision_helper.c.revision_id == one_file.revision_id) \
78
+            .where(revision_helper.c.revision_id == file.revision_id) \
79 79
             .values(depot_file=depot_file_field) \
80 80
             .return_defaults()
81 81
         connection.execute(update_query)