Skip to content

Commit

Permalink
corrige les erreurs dans les paramètres GET
Browse files Browse the repository at this point in the history
  • Loading branch information
dralliw committed Aug 21, 2014
1 parent 17bb431 commit 03e1896
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions zds/forum/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def topic(request, topic_pk, topic_slug):
categories = Category.objects.all()
try:
page_nbr = int(request.GET["page"])
except KeyError:
except:
page_nbr = 1
try:
posts = paginator.page(page_nbr)
Expand Down Expand Up @@ -233,7 +233,7 @@ def new(request):

try:
forum_pk = request.GET["forum"]
except KeyError:
except:
raise Http404
forum = get_object_or_404(Forum, pk=forum_pk)
if not forum.can_read(request.user):
Expand Down Expand Up @@ -344,7 +344,7 @@ def move_topic(request):
raise PermissionDenied
try:
topic_pk = request.GET["sujet"]
except KeyError:
except:
raise Http404
forum = get_object_or_404(Forum, pk=request.POST["forum"])
if not forum.can_read(request.user):
Expand Down Expand Up @@ -374,11 +374,11 @@ def edit(request):

try:
topic_pk = request.POST["topic"]
except KeyError:
except:
raise Http404
try:
page = int(request.POST["page"])
except KeyError:
except:
page = 1
data = request.POST
resp = {}
Expand Down Expand Up @@ -409,7 +409,7 @@ def edit(request):
if "move" in data:
try:
forum_pk = int(request.POST["move_target"])
except KeyError:
except:
raise Http404
forum = get_object_or_404(Forum, pk=forum_pk)
g_topic.forum = forum
Expand All @@ -432,7 +432,7 @@ def answer(request):

try:
topic_pk = request.GET["sujet"]
except KeyError:
except:
raise Http404

# Retrieve current topic.
Expand Down Expand Up @@ -589,7 +589,7 @@ def edit_post(request):

try:
post_pk = request.GET["message"]
except KeyError:
except:
raise Http404
post = get_object_or_404(Post, pk=post_pk)
if not post.topic.forum.can_read(request.user):
Expand Down Expand Up @@ -715,7 +715,7 @@ def useful_post(request):

try:
post_pk = request.GET["message"]
except KeyError:
except:
raise Http404
post = get_object_or_404(Post, pk=post_pk)

Expand All @@ -741,7 +741,7 @@ def unread_post(request):

try:
post_pk = request.GET["message"]
except KeyError:
except:
raise Http404
post = get_object_or_404(Post, pk=post_pk)

Expand Down Expand Up @@ -775,7 +775,7 @@ def like_post(request):

try:
post_pk = request.GET["message"]
except KeyError:
except:
raise Http404
resp = {}
post = get_object_or_404(Post, pk=post_pk)
Expand Down Expand Up @@ -822,7 +822,7 @@ def dislike_post(request):

try:
post_pk = request.GET["message"]
except KeyError:
except:
raise Http404
resp = {}
post = get_object_or_404(Post, pk=post_pk)
Expand Down

0 comments on commit 03e1896

Please sign in to comment.