Browse Source

Simplified boolean variable check

Currently 'self.cells' is being checked
for empty list like 'if self.cells == []:'.
The more standard approach is like 'if not self.cells:'.

TrivialFix

Change-Id: I681e11c13696f3e85c3598838ac5ed33c378de3f
Ravi Shekhar Jethani 3 years ago
parent
commit
44ed0a452c
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      horizon/tables/formset.py

+ 1
- 1
horizon/tables/formset.py View File

@@ -51,7 +51,7 @@ class FormsetRow(horizon_tables.Row):
51 51
     def __init__(self, column, datum, form):
52 52
         self.form = form
53 53
         super(FormsetRow, self).__init__(column, datum)
54
-        if self.cells == []:
54
+        if not self.cells:
55 55
             # We need to be able to handle empty rows, because there may
56 56
             # be extra empty forms in a formset. The original DataTable breaks
57 57
             # on this, because it sets self.cells to [], but later expects a

Loading…
Cancel
Save