Ejemplo n.º 1
0
        def fetch_content():
            """
            Extract the forum object from the keyword arguments to the view.
            """
            user_group_id = None
            content_user_group_id = None
            if "thread_id" in kwargs:
                content = cc.Thread.find(kwargs["thread_id"]).to_dict()
            elif "comment_id" in kwargs:
                content = cc.Comment.find(kwargs["comment_id"]).to_dict()
            elif "commentable_id" in kwargs:
                content = cc.Commentable.find(kwargs["commentable_id"]).to_dict()
            else:
                content = None

            if 'username' in content:
                (user_group_id, content_user_group_id) = get_user_group_ids(course_key, content, request.user)
            return content, user_group_id, content_user_group_id
Ejemplo n.º 2
0
Archivo: views.py Proyecto: saadow123/1
        def fetch_content():
            """
            Extract the forum object from the keyword arguments to the view.
            """
            user_group_id = None
            content_user_group_id = None
            if "thread_id" in kwargs:
                content = cc.Thread.find(kwargs["thread_id"]).to_dict()
            elif "comment_id" in kwargs:
                content = cc.Comment.find(kwargs["comment_id"]).to_dict()
            elif "commentable_id" in kwargs:
                content = cc.Commentable.find(kwargs["commentable_id"]).to_dict()
            else:
                content = None

            if 'username' in content:
                (user_group_id, content_user_group_id) = get_user_group_ids(course_key, content, request.user)
            return content, user_group_id, content_user_group_id