예제 #1
0
파일: views.py 프로젝트: JTLX/pybbm
 def get_object(self, queryset=None):
     post = get_object_or_404(Post.objects.select_related("topic", "topic__forum"), pk=self.kwargs["pk"])
     if not perms.may_delete_post(self.request.user, post):
         raise PermissionDenied
     self.topic = post.topic
     self.forum = post.topic.forum
     return post
예제 #2
0
파일: views.py 프로젝트: pbiogy/pybbm
 def get_object(self, queryset=None):
     post = get_object_or_404(Post.objects.select_related('topic', 'topic__forum'), pk=self.kwargs['pk'])
     if not perms.may_delete_post(self.request.user, post):
         raise PermissionDenied
     self.topic = post.topic
     self.forum = post.topic.forum
     if not perms.may_moderate_topic(self.request.user, self.topic):
         raise PermissionDenied
     return post
예제 #3
0
파일: views.py 프로젝트: pybest/pybbm
 def get_object(self, queryset=None):
     post = get_object_or_404(Post.objects.select_related(
         'topic', 'topic__forum'),
                              pk=self.kwargs['pk'])
     if not perms.may_delete_post(self.request.user, post):
         raise PermissionDenied
     self.topic = post.topic
     self.forum = post.topic.forum
     return post