예제 #1
0
def set_new_start_argument(request):
    """
    Inserts a new argument as starting point into the database

    :param request: request of the web server
    :return: a status code, if everything was successful
    """
    LOG.debug("Insert a new argument as starting point: %s", request.json_body)
    reason = request.validated['reason']

    # set the new position
    LOG.debug("Set conclusion/position")
    prepared_dict_pos = set_position(request.validated['user'],
                                     request.validated['issue'],
                                     request.validated['position'])

    if len(prepared_dict_pos['error']) == 0:
        LOG.debug("Set premise/reason")
        prepared_dict_pos = set_positions_premise(
            request.validated['issue'], request.validated['user'],
            DBDiscussionSession.query(Statement).get(
                prepared_dict_pos['statement_uids'][0]), [[reason]], True,
            request.cookies.get('_HISTORY_'), request.mailer)
    __modifiy_discussion_url(prepared_dict_pos)

    return prepared_dict_pos
예제 #2
0
def set_new_premises_for_argument(request):
    """
    Sets a new premise for an argument

    :param request: request of the web server
    :return: json-dict()
    """
    LOG.debug("Set new premise for an argument. %s", request.json_body)
    prepared_dict = set_arguments_premises(
        request.validated['issue'], request.validated['user'],
        request.validated['argument'], request.validated['premisegroups'],
        relation_mapper[request.validated['attack_type']],
        request.cookies['_HISTORY_']
        if '_HISTORY_' in request.cookies else None, request.mailer)
    __modifiy_discussion_url(prepared_dict)
    return prepared_dict
예제 #3
0
def set_new_start_premise(request):
    """
    Sets new premise for the start

    :param request: request of the web server
    :return: json-dict()
    """
    LOG.debug("Set new premise for start: %s", request.json_body)
    prepared_dict = set_positions_premise(request.validated['issue'],
                                          request.validated['user'],
                                          request.validated['conclusion'],
                                          request.validated['premisegroups'],
                                          request.validated['supportive'],
                                          request.cookies.get('_HISTORY_'),
                                          request.mailer)
    __modifiy_discussion_url(prepared_dict)
    return prepared_dict