This commit is contained in:
Anna Sudnitsina 2017-12-12 13:33:52 +03:00
parent ffa7d63178
commit 5ae2b493d2

View File

@ -30,7 +30,7 @@ def image_new(request):
post = form.save(commit=False)
post.save()
create_thumb_from_file(post.orig_name)
return redirect('imagehosting.views.image_detail', pk=post.id)
return redirect('image_detail', pk=post.id)
else:
form = PostForm()
return render(request, 'imagehosting/index.html', {'form': form})
@ -55,5 +55,5 @@ def delete_post(request, pk):
if not request.user.is_authenticated():
return HttpResponseRedirect('/admin')
post_to_delete.delete()
return redirect('imagehosting.views.all_posts')
return redirect('all_posts')
return render(request, 'imagehosting/delete.html', {'form': form})