56def strip_tags(html):
57 if html is None:
58 return None
59 return bleach.clean(html, tags=[], attributes={}, styles=[], strip=True)
45 tags.append('a')
46 attrs['a'] = ['href']
47 styles = ['text-align', 'font-weight', 'text-decoration']
48 cleaned = bleach.clean(html, tags=tags, attributes=attrs, styles=styles, strip=True)49 return bleach.linkify(
50 cleaned,
51 callbacks=[nofollow, target_blank],
84def strip_tags(html):
85 if html is None:
86 return None
87 return bleach.clean(html, tags=[], attributes={}, styles=[], strip=True) 88
89
90def get_serializer(secret_key=None):
27 from .helpers.tasks import delete_translations
28
29 delete_translations.apply_async(kwargs={'zip_file_path': path_to_zip}, countdown=600)
30 return send_file(31 path_to_zip,
32 mimetype='application/zip',
33 as_attachment=True,
The function call has passed a keyword argument that doesn't correspond to one of the function's parameter names. This is an error.
def update_count(item, available=True)
if available:
count[item] += 1
update_count("coffee", is_available=True) # Wrong keyword arguemnt used
def update_count(item, available=True)
if available:
count[item] += 1
update_count("coffee", available=False)