Removed title and slug field from blogpost model and db
This commit is contained in:
@@ -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()
|
||||
|
||||
# ...
|
||||
|
||||
Reference in New Issue
Block a user