This commit is contained in:
xieshen 2020-10-21 12:02:05 +08:00
parent 694a011de1
commit 6b505bbbe4
2 changed files with 8 additions and 3 deletions

View File

@ -1696,14 +1696,19 @@ def news_management_update(request,pk):
t = '6'
if request.FILES.get('image'):
image = request.FILES.get('image')
n = News.objects.get(id=pk)
if request.POST.get('date'):
date = request.POST.get('date')
News.objects.filter(id=pk).update(type=t, title=title, author=author, date=date, content=content, source=source)
news.image = image
news.save()
n.image = image
n.save()
else:
News.objects.filter(id=pk).update(type=t, title=title, author=author, content=content,
source=source, image=image)
source=source)
n.image = image
n.save()
else:
News.objects.filter(id=pk).update(type=t, title=title, author=author, content=content,
source=source)

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 KiB