Project

General

Profile

0001-sql-don-t-barf-on-ranked-items-saved-as-strings-1032.patch

Frédéric Péters, 17 March 2016 10:06 AM

Download (984 Bytes)

View differences:

Subject: [PATCH] sql: don't barf on ranked items saved as strings (#10324)

This can happen when invalid drafts are restored.
 wcs/sql.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
wcs/sql.py
921 921
                if field.key == 'ranked-items':
922 922
                    d = {}
923 923
                    for data, rank in value:
924
                        d[data] = int(rank)
924
                        try:
925
                            d[data] = int(rank)
926
                        except ValueError:
927
                            d[data] = rank
925 928
                    value = d
926 929
                elif field.key == 'password':
927 930
                    d = {}
928
-