0001-fields-ignore-errors-for-shorter-than-expected-rows-.patch
wcs/fields.py | ||
---|---|---|
1484 | 1484 | |
1485 | 1485 |
for i, row_value in enumerate(value): |
1486 | 1486 |
for j, column in enumerate(self.columns): |
1487 |
max_width = max(max_width, len(row_value[j])) |
|
1487 |
try: |
|
1488 |
max_width = max(max_width, len(row_value[j])) |
|
1489 |
except IndexError: |
|
1490 |
# ignore errors for shorter than expected rows, this is |
|
1491 |
# typical of the field gaining new columns after some forms |
|
1492 |
# were already saved. |
|
1493 |
pass |
|
1488 | 1494 | |
1489 | 1495 |
r.append(' '.join(['='*max_width]*(len(self.columns)))) |
1490 | 1496 |
r.append(' '.join([column.center(max_width) for column in self.columns])) |
1491 |
- |