Browse Source

Escape resource name

Change-Id: Ia39c6677fb5d53474611ef227cb793205a641a28
Feilong Wang 7 months ago
parent
commit
91dcb51d28
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      distil_ui/api/distil_v2.py

+ 5
- 0
distil_ui/api/distil_v2.py View File

@@ -18,6 +18,7 @@ import logging
18 18
 import six
19 19
 
20 20
 from django.conf import settings
21
+from django.utils.html import escape
21 22
 
22 23
 from openstack_dashboard.api import base
23 24
 
@@ -175,6 +176,8 @@ def _parse_invoice(invoice):
175 176
         for product in services["breakdown"]:
176 177
             for order_line in services["breakdown"][product]:
177 178
                 order_line["product"] = product
179
+                order_line["resource_name"] = escape(
180
+                    order_line["resource_name"])
178 181
                 details.append(order_line)
179 182
     LOG.debug("Got quotations successfully.")
180 183
     return parsed
@@ -193,6 +196,8 @@ def _parse_quotation(quotation, merged_quotations, region=None):
193 196
         for product in services["breakdown"]:
194 197
             for order_line in services["breakdown"][product]:
195 198
                 order_line["product"] = product
199
+                order_line["resource_name"] = escape(
200
+                    order_line["resource_name"])
196 201
                 details.append(order_line)
197 202
 
198 203
     return parsed

Loading…
Cancel
Save