Fix iteration bug while removing attributes

This commit is contained in:
2019-10-21 17:53:44 +02:00
parent 422ed5b4e6
commit 228be9f4be

View File

@@ -87,6 +87,7 @@ class EMailNotification(BaseNotification):
"border",
"cellpadding",
"cellspacing",
"class",
"color",
"colspan",
"dir",
@@ -247,7 +248,7 @@ class EMailNotification(BaseNotification):
# remove not whitelisted attributes
for element in soup.find_all(True):
for attribute in element.attrs.keys():
for attribute in list(element.attrs.keys()):
if attribute not in EMailNotification.good_attributes:
if element.name == "a" and attribute == "href":
self.logger.debug(