heroku
This commit is contained in:
parent
ffa7d63178
commit
5ae2b493d2
|
@ -30,7 +30,7 @@ def image_new(request):
|
||||||
post = form.save(commit=False)
|
post = form.save(commit=False)
|
||||||
post.save()
|
post.save()
|
||||||
create_thumb_from_file(post.orig_name)
|
create_thumb_from_file(post.orig_name)
|
||||||
return redirect('imagehosting.views.image_detail', pk=post.id)
|
return redirect('image_detail', pk=post.id)
|
||||||
else:
|
else:
|
||||||
form = PostForm()
|
form = PostForm()
|
||||||
return render(request, 'imagehosting/index.html', {'form': form})
|
return render(request, 'imagehosting/index.html', {'form': form})
|
||||||
|
@ -55,5 +55,5 @@ def delete_post(request, pk):
|
||||||
if not request.user.is_authenticated():
|
if not request.user.is_authenticated():
|
||||||
return HttpResponseRedirect('/admin')
|
return HttpResponseRedirect('/admin')
|
||||||
post_to_delete.delete()
|
post_to_delete.delete()
|
||||||
return redirect('imagehosting.views.all_posts')
|
return redirect('all_posts')
|
||||||
return render(request, 'imagehosting/delete.html', {'form': form})
|
return render(request, 'imagehosting/delete.html', {'form': form})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user