Skip to content

Commit

Permalink
fix #254
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Oct 31, 2024
1 parent 04f78be commit 8a83b84
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions auctions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3085,6 +3085,10 @@ def description_label(self):
"""Strip all html except <br> from summernote description"""
return re.sub(r"(?!<br\s*/?>)<.*?>", "", self.summernote_description)

@property
def description_cleaned(self):
return re.sub(r'(style="[^"]*?)color:[^;"]*;?([^"]*")', r"\1\2", self.summernote_description)


class Invoice(models.Model):
"""
Expand Down
2 changes: 1 addition & 1 deletion auctions/templates/view_lot_images.html
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ <h3>{{ lot.lot_name }}</h3>
<br>
<div class="bg-dark mt-2 mb-2">
<div class='ms-2 me-2 mb-1'>
{{ lot.summernote_description | safe }}<br>
{{ lot.description_cleaned | safe }}<br>
<a href="{{lot.reference_link}}">More information from {{lot.reference_link_domain}}</a>
</div><br>
</div>
Expand Down
2 changes: 1 addition & 1 deletion auctions/templates/view_lot_simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h3>{{ lot.lot_name }}</h3>
No bids
{% endif %}
{% endif %}<br>
{{ lot.summernote_description | safe }}
{{ lot.description_cleaned | safe }}
</div>
</div>
</div>
Expand Down

0 comments on commit 8a83b84

Please sign in to comment.