From 38d9928d096a2ea179cb5160b4802cc31b20b271 Mon Sep 17 00:00:00 2001 From: Ahmed Ossama <58595131+AhmedOssama22dev@users.noreply.github.com> Date: Wed, 4 Aug 2021 02:23:22 +0200 Subject: [PATCH] Update html.py --- rest_framework/utils/html.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rest_framework/utils/html.py b/rest_framework/utils/html.py index 1a3bd88da..759b75792 100644 --- a/rest_framework/utils/html.py +++ b/rest_framework/utils/html.py @@ -69,8 +69,7 @@ def parse_html_list(dictionary, prefix='', default=None): """ if isinstance(dictionary, (list, tuple)): dictionary = str(dictionary)[1:-1] - dictionary = '{' + dictionary[1:-1].replace('}', '').replace('{', '') + '}' - dictionary = eval(dictionary) + dictionary = eval('{' + dictionary[1:-1].replace('}', '').replace('{', '') + '}') ret = {} regex = re.compile(r'^%s\[([0-9]+)\](.*)$' % re.escape(prefix))