Commits

Stanislav Panasik committed 4d13a2e

Fixed bug in add_post_ctx when forum value should be None in case of new topic, but it is set to some value due to permissions checks. Renamed to request_forum.

Comments (0)

Files changed (1)

         forum = get_object_or_404(Forum, pk=forum_id)        
     elif topic_id:
         topic = get_object_or_404(Topic, pk=topic_id)
+    
+    request_forum = forum
+    if request_forum is None:
+        request_forum = topic.forum
         
-    if forum is None:
-        forum = topic.forum
-        
-    if (not request.user.is_superuser) and (have_permissions(request, forum, 'deny-create-topic') or \
-           have_permissions(request, forum, 'deny-view-forum') or \
-           have_permissions(request, forum, 'deny-add-post')):
+    if (not request.user.is_superuser) and (have_permissions(request, request_forum, 'deny-create-topic') or \
+           have_permissions(request, request_forum, 'deny-view-forum') or \
+           have_permissions(request, request_forum, 'deny-add-post')):
         return HttpResponseRedirect('/')
 
     try: