def lock(self, request, *args, **kwargs):
        """ Locks the considered topic and retirects the user to the success URL. """
        self.object = self.get_object()
        success_url = self.get_success_url()
        self.object.status = Topic.TOPIC_LOCKED
        self.object.save()
        messages.success(self.request, self.success_message)
        return HttpResponseRedirect(success_url)
def lock ( self , request , * args , ** kwargs ) : self . object = self . get_object ( ) success_url = self . get_success_url ( ) self . object . status = Topic . TOPIC_LOCKED self . object . save ( ) messages . success ( self . request , self . success_message ) return HttpResponseRedirect ( success_url )
Locks the considered topic and retirects the user to the success URL.