Beispiel #1
0
def set_playback_data(request):
    try:
        comment_id = request.POST['comment_id']
    except KeyError:
        raise ServiceError("Missing comment ID.")

    comment = get_object_or_404(QuestComment, id=comment_id)

    playback_data = request.POST['playback_data']

    PlaybackData.create_with_json(comment, playback_data)
Beispiel #2
0
def create_quest_comment(quest=None, author=None, playback_data=None):
    if author is None:
        author = create_user()

    if quest is None:
        quest = create_quest()

    content = create_content()
    cmt = create_comment(parent_comment=quest, reply_content=content, author=author)

    cmt = QuestComment.objects.get(id=cmt.id)

    if playback_data is not None:
        PlaybackData.create_with_json(cmt, playback_data)

    return cmt
Beispiel #3
0
def create_quest_comment(quest=None, author=None, playback_data=None):
    if author is None:
        author = create_user()

    if quest is None:
        quest = create_quest()

    content = create_content()
    cmt = create_comment(parent_comment=quest,
                         reply_content=content,
                         author=author)

    cmt = QuestComment.objects.get(id=cmt.id)

    if playback_data is not None:
        PlaybackData.create_with_json(cmt, playback_data)

    return cmt