Commit 55a760a54e1e49b74c980e4cfa79a4b6054c5d9b
Add backward compatible code for registered user list
Production database still contains users as 'author' instead of 'who'. So
backward compatible code is needed to workaround, else the script fails with a
500(KeyError).
| | | | 247 | for row in res: | 247 | for row in res: |
---|
248 | d = row | 248 | d = row |
---|
249 | d['id'] = str(row['_id']) | 249 | d['id'] = str(row['_id']) |
---|
250 | if d['who'] in getUsers(): | | if d['who'] in getUsers(): |
---|
251 | d['registered'] = True | | d['registered'] = True |
---|
| | 250 | try: | | | 251 | if d['who'] in getUsers() || d['author'] in getUsers(): |
---|
| | 252 | d['registered'] = True |
---|
| | 253 | except KeyError: |
---|
| | 254 | pass |
---|
252 | entries.append(d) | 255 | entries.append(d) |
---|
253 | return entries | 256 | return entries |
---|
254 | | 257 | |
---|