File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
django_project/changes/management/commands Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,14 @@ python manage.py update-versions-release-date
8888# Exit the shell with CTRL+D
8989```
9090
91+ To fix display issues with entries (notable fixes tables...), run:
92+
93+ ```
94+ make uwsgi-shell
95+ python manage.py fix_broken_entries
96+ # Exit the shell with CTRL+D
97+ ```
98+
9199** intercom.io**
92100
93101If you wish to make use of [ intercom.io] ( https://www.intercom.io ) , include a
Original file line number Diff line number Diff line change 1+ from django .core .management .base import BaseCommand
2+ from changes .models import Entry
3+
4+
5+ class Command (BaseCommand ):
6+ help = 'Fix broken entries by removing <p> and </p> tags from descriptions'
7+
8+ def handle (self , * args , ** kwargs ):
9+ entries = Entry .objects .all ()
10+ for entry in entries :
11+ if entry .description and '<p>' in entry .description :
12+ entry .description = entry .description .replace ('<p>' , '' ).replace ('</p>' , '' )
13+ entry .save ()
14+ self .stdout .write (self .style .SUCCESS ('Successfully fixed broken entries' ))
You can’t perform that action at this time.
0 commit comments