summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkihiro Motoki <amotoki@gmail.com>2021-09-22 19:37:44 +0900
committerAkihiro Motoki <amotoki@gmail.com>2021-09-22 19:41:55 +0900
commita20c4f6f2218255597c719aa7505295f689abf9a (patch)
treea15686ac6addd4888f68754f9be6e64dcfe569d2
parent0f34f6e7edff7195519dea3f1298efae2f8abd51 (diff)
downloadhorizon-a20c4f6f2218255597c719aa7505295f689abf9a.tar.gz
workflow: Do not touch dict during iteration20.1.0
Django 3.2 stored the field information as dict instead OrderedDict because python 3.7+ ensure the field order of dict as the language spec. We cannot touch dict itself during iteration. We need to pass a list instead of a value from .items() itself to avoid the error. Change-Id: Ie22865995d14fa60c16cf2cea582aa0eec46b65d Closes-Bug: #1944548
-rw-r--r--horizon/workflows/base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/horizon/workflows/base.py b/horizon/workflows/base.py
index 66f63006f..4ceafaf9a 100644
--- a/horizon/workflows/base.py
+++ b/horizon/workflows/base.py
@@ -169,7 +169,7 @@ class Action(forms.Form, metaclass=ActionMetaclass):
return "<%s: %s>" % (self.__class__.__name__, self.slug)
def _populate_choices(self, request, context):
- for field_name, bound_field in self.fields.items():
+ for field_name, bound_field in list(self.fields.items()):
meth = getattr(self, "populate_%s_choices" % field_name, None)
if meth is not None and callable(meth):
bound_field.choices = meth(request, context)