Skip to content

Commit

Permalink
Merge 0228072 into 783e374
Browse files Browse the repository at this point in the history
  • Loading branch information
Silveron committed Feb 4, 2020
2 parents 783e374 + 0228072 commit 8ab8395
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arctic/generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import csv
import json
from collections import OrderedDict
import re

import extra_views
from django.conf import settings
Expand Down Expand Up @@ -653,6 +654,7 @@ def csv_file_response(self):
writer = csv.writer(response)
writer.writerow(titles)

re_strip_tags = re.compile(r'<.*?>')
m2m_fields = [m2m_f.attname for m2m_f in model._meta.many_to_many]
for obj in self.get_object_list():
row = []
Expand All @@ -673,7 +675,7 @@ def csv_file_response(self):
field_value = ", ".join(
[str(obj) for obj in field_value.get_queryset()]
)
row.append(field_value)
row.append(re.sub(re_strip_tags, '', str(field_value)).strip())
writer.writerow(row)

return response
Expand Down

0 comments on commit 8ab8395

Please sign in to comment.