Exemplo n.º 1
0
        errorMessage = 'reason'
    return errorMessage


if query_string:
    parser = FormParser()
    parser.parse_values(query_string)

    conn = Connection()
    reason = parser.get_value("reason", "")
    message = parser.get_value("message", "")

    sess = session.Session(expires=365 * 24 * 60 * 60, cookie_path='/')
    #lastvisit = sess.data.get('lastvisit')
    #sess.data['lastvisit'] = repr(time.time())
    user = conn.autorized_session(sess.cookie['sid'].value)
    if user is not None and user is not '403':
        user_id = user.user_id
        name = user.username
        email = user.email
        if message and reason:
            suggestion = Suggestion(user_id, '', reason, message, name, email)
            creeateSuggestion = conn.create_suggestion(suggestion)
        else:
            result = validate_properties()
    else:
        Fordiben = True

__ERRORS = {}
if result:
    if result == 'all':
Exemplo n.º 2
0
def fetch_authorized_user_session():
    sess = helpers.build_session_entity()
    conn = Connection()
    return conn.autorized_session(sess.cookie['sid'].value)