Removed title and slug field from blogpost model and db

This commit is contained in:
2016-02-25 09:37:03 +01:00
parent 5b033803a8
commit 62ec42297d
9 changed files with 14 additions and 43 deletions

View File

@@ -449,17 +449,6 @@ def blogindex(request, page):
'page': page
})
@login_required
def blogpost(request, slug):
# get the Post object
post = get_object_or_404(Post, slug=slug)
# now return the rendered template
return render(request, 'blogpost.html', {
'post': post,
'ls': get_current_ls(),
'season': get_current_season()
})
@login_required
def newBlogpost(request):
"""
@@ -470,12 +459,8 @@ def newBlogpost(request):
form = BlogpostForm(request.POST)
# check whether it's valid:
if form.is_valid():
# process the data
# fix me
# What to to, if subject is empty?
data = form.cleaned_data
slug = slugify(data['title'])
p = Post(author_id=request.user.id, slug=slug, title=data['title'], content=data['content'])
p = Post(author_id=request.user.id, content=data['content'])
p.save()
# ...