def form_valid(self, form):
        """ Handles a valid form. """
        # Move the topic
        topic = self.object
        old_forum = topic.forum
        new_forum = form.cleaned_data['forum']
        topic.forum = new_forum

        # Eventually lock the topic
        if form.cleaned_data['lock_topic']:
            topic.status = Topic.TOPIC_LOCKED
        else:
            topic.status = Topic.TOPIC_MOVED

        topic.save()
        old_forum.save()

        messages.success(self.request, self.success_message)
        return HttpResponseRedirect(self.get_success_url())
Handles a valid form.