Skip to content

Commit

Permalink
Fix first save bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
Renato committed Dec 5, 2017
1 parent ca726d4 commit a7cf245
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions notto/nottoapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,17 @@ def note(request, note_name):
if request.method == 'GET':
raise Note.DoesNotExist
elif request.method == 'POST':
print(request)
print(request.POST)
if 'content' not in request.POST:
return render(
request,
'note.html',
{
'content': '',
'note_url': note_name
}
)
note = Note(
content='',
content=request.POST['content'],
url_title=note_name
)
note.save()
Expand Down

0 comments on commit a7cf245

Please sign in to comment.