Пример #1
0
def user_activity(user_id):
    user = vault.get_user_from_runtime_storage(user_id)
    if not user:
        flask.abort(404)
    user = helpers.extend_user(user)

    memory_storage_inst = vault.get_memory_storage()
    result = _get_activity_summary(
        memory_storage_inst.get_record_ids_by_user_ids([user_id]))
    result['user'] = user

    return result
Пример #2
0
def user_activity(user_id):
    user = vault.get_user_from_runtime_storage(user_id)
    if not user:
        flask.abort(404)
    user = helpers.extend_user(user)

    memory_storage_inst = vault.get_memory_storage()
    result = _get_activity_summary(
        memory_storage_inst.get_record_ids_by_user_ids([user_id]))
    result['user'] = user

    return result
Пример #3
0
def user_activity(user_id):
    user = vault.get_user_from_runtime_storage(user_id)
    if not user:
        flask.abort(404)
    user = helpers.extend_user(user)

    memory_storage_inst = vault.get_memory_storage()
    records = memory_storage_inst.get_records(
        memory_storage_inst.get_record_ids_by_user_ids([user_id]))
    records = sorted(records, key=operator.itemgetter('date'), reverse=True)

    return {
        'user': user,
        'total_records': len(records),
        'contribution': helpers.get_contribution_summary(records),
        'punch_card_data': _get_punch_card_data(records),
    }
Пример #4
0
def user_activity(user_id):
    user = vault.get_user_from_runtime_storage(user_id)
    if not user:
        flask.abort(404)
    user = helpers.extend_user(user)

    memory_storage_inst = vault.get_memory_storage()
    records = memory_storage_inst.get_records(
        memory_storage_inst.get_record_ids_by_user_ids([user_id]))
    records = sorted(records, key=operator.itemgetter('date'), reverse=True)

    return {
        'user': user,
        'total_records': len(records),
        'contribution': helpers.get_contribution_summary(records),
        'punch_card_data': _get_punch_card_data(records),
    }
Пример #5
0
def get_user(user_id):
    user = vault.get_user_from_runtime_storage(user_id)
    if not user:
        flask.abort(404)
    user = helpers.extend_user(user)
    return user
Пример #6
0
def get_user(user_id):
    user = vault.get_user_from_runtime_storage(user_id)
    if not user:
        flask.abort(404)
    user = helpers.extend_user(user)
    return user