Merge "Deal with bytestring serialized json"

Zuul 2023-05-23 12:46:42 +00:00 committed by Gerrit Code Review
commit ecd4f03a02
1 changed files with 7 additions and 1 deletions

View File

@ -178,7 +178,13 @@ class CreateStackView(forms.ModalFormView):
if 'environment_data' in self.kwargs:
initial['environment_data'] = self.kwargs['environment_data']
if 'parameters' in self.kwargs:
initial['parameters'] = json.dumps(self.kwargs['parameters'])
parameters = self.kwargs['parameters']
# if instead of a dict we got a bytestring of
# serialized json we don't double dumps it
if isinstance(parameters, bytes):
initial['parameters'] = parameters
initial['parameters'] = json.dumps(parameters)
return initial
def get_form_kwargs(self):