Skip to content

Commit

Permalink
[수정] 게시물 수정 오류해결
Browse files Browse the repository at this point in the history
  • Loading branch information
HamInKyou committed Jun 20, 2021
1 parent ae45e86 commit 60728ec
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion instagramAssignment/instagram/templates/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
>
<!--method POST를 썼다면 아래의 토큰을 꼭 명시해주자!-->
{%csrf_token%}
<p>작성자: <input type="text" name="writer" value="{{post.writer}}" /></p>
<p>사진: <input type="file" name="image" /></p>
<button type="submit">submit</button>
</form>
Expand Down
1 change: 1 addition & 0 deletions instagramAssignment/instagram/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def update(request, postId):
form = PostForm(request.POST,request.FILES)
if form.is_valid():
update_post = form.save(commit=False)
update_post.writer = request.user
update_post.pub_date = timezone.now()
update_post.save()
return redirect('detail', update_post.id)
Expand Down

0 comments on commit 60728ec

Please sign in to comment.