Esempio n. 1
0
    def post(_, lang, topic_id):

        sid = transaction.savepoint()
        if lang == 'ja':
            topic_model = Topic()
            video_model = Video()
        else:
            topic_model = TopicEn()
            video_model = VideoEn()

        try:
            video_model.remove_video_from_topic(topic_id)
            topic_model.delete_topic(topic_id)
            topic_model.remove_image(topic_id)
            transaction.savepoint_commit(sid)

        except:

            transaction.savepoint_rollback(sid)
            pass

        return HttpResponseRedirect('/{}/admin/topics'.format(lang))