This commit is contained in:
xieshen 2020-10-21 11:50:20 +08:00
parent ec028bf23b
commit 694a011de1
1 changed files with 3 additions and 1 deletions

View File

@ -1698,7 +1698,9 @@ def news_management_update(request,pk):
image = request.FILES.get('image') image = request.FILES.get('image')
if request.POST.get('date'): if request.POST.get('date'):
date = 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, image=image) News.objects.filter(id=pk).update(type=t, title=title, author=author, date=date, content=content, source=source)
news.image = image
news.save()
else: else:
News.objects.filter(id=pk).update(type=t, title=title, author=author, content=content, News.objects.filter(id=pk).update(type=t, title=title, author=author, content=content,
source=source, image=image) source=source, image=image)