aboutsummaryrefslogtreecommitdiff
path: root/blog_admin
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-11-22 03:36:36 -0500
committerBobby <[email protected]>2022-11-22 03:36:36 -0500
commit29b628855d5d6c56e9f15585dbce1bd1849224b7 (patch)
treed725afbc6d79a8fb511e3ca02bf99c020a3eb32d /blog_admin
parent483adbdabee305c992052e81d7a26a96fa9b1eaa (diff)
downloadthatcomputerscientist-29b628855d5d6c56e9f15585dbce1bd1849224b7.tar.xz
thatcomputerscientist-29b628855d5d6c56e9f15585dbce1bd1849224b7.zip
object storage for uploading images and enhancements
Diffstat (limited to 'blog_admin')
-rw-r--r--blog_admin/views.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/blog_admin/views.py b/blog_admin/views.py
index ab087e62..75b58507 100644
--- a/blog_admin/views.py
+++ b/blog_admin/views.py
@@ -5,8 +5,6 @@ from django.contrib.auth.models import User
from django.contrib import messages
from blog.models import Post, Category, Tag
import re
-from io import BytesIO
-from PIL import Image
# Create your views here.
@@ -48,6 +46,8 @@ def new_post(request):
title = request.POST.get('title')
body = request.POST.get('body')
body = re.sub(r'<p><br></p>', '', body)
+ body = re.sub(r'<p class="ql-align-justify"><br></p>', '', body)
+ body = re.sub(r'<p class="ql-align-center"><br></p>', '', body)
category = request.POST.get('category')
tags = request.POST.get('tags')
slug = request.POST.get('slug')
@@ -86,6 +86,8 @@ def edit_post(request, slug):
title = request.POST.get('title')
body = request.POST.get('body')
body = re.sub(r'<p><br></p>', '', body)
+ body = re.sub(r'<p class="ql-align-justify"><br></p>', '', body)
+ body = re.sub(r'<p class="ql-align-center"><br></p>', '', body)
category = request.POST.get('category')
tags = request.POST.get('tags')
slug = request.POST.get('slug')