Fix dictionary changed size during iteration error with Python 3
In Python 2, dict.keys() would return a copy of the keys as a list which could be modified. In Python 3 it is returned as an iterator which can't be modified, so simply cast it as a list. Change-Id: I0c955337b689ad2cbdb3975ca4f1ddd52e277a70
This commit is contained in:
parent
43efb80725
commit
27483f3c65
|
@ -212,7 +212,7 @@ def clear_forms_data(func):
|
|||
LOG.debug('Clearing forms data for application {0}.'.format(fqn))
|
||||
services.get_apps_data(request)[app_id] = {}
|
||||
LOG.debug('Clearing any leftover wizard step data.')
|
||||
for key in request.session.keys():
|
||||
for key in list(request.session.keys()):
|
||||
# TODO(tsufiev): unhardcode the prefix for wizard step data
|
||||
if key.startswith('wizard_wizard'):
|
||||
request.session.pop(key)
|
||||
|
|
Loading…
Reference in New Issue